Re: Multi-threading with multi-port server
- From: "Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp>
- Date: Mon, 21 Jan 2008 12:04:16 -0500
"Rehmet" <rgnurrahmat@xxxxxxxxx> wrote in message news:8f9b7615-8252-4661-9949-8812b735aa00@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi guys,
Can I ask your guidance on how to imeplement server with multi-
threading and multi-port? meaning, I would like my server to receive
audio and video in different ports, and they run concurrently and send
the data to clients.
I am so lost, because I would mess up my .accept and .listen and
setparent if i have videosocket and audiosocket object. I tried and it
just froze.
You don't need multiple threads to handle multiple socket ports. If you use asynchronous sockets then all socket calls return quickly and you can run several sockets concurrently in the main thread.
Whatever you are using for a socket library, see if it supports asynchronous (i.e. non-blocking) sockets. These are available from MFC CAsyncSocket, or from winsock if you use WSAAsyncSelect or WSAEventSelect.
--
Scott McPhillips [VC++ MVP]
.
- References:
- Multi-threading with multi-port server
- From: Rehmet
- Multi-threading with multi-port server
- Prev by Date: Re: event sink in MFC dll
- Next by Date: Re: MFC calling another MFC
- Previous by thread: Multi-threading with multi-port server
- Next by thread: Re: Multi-threading with multi-port server
- Index(es):
Relevant Pages
|