Re: What is better Blocking Sockets or Async?
- From: "Alexander Nickolov" <agnickolov@xxxxxxxx>
- Date: Thu, 12 Jul 2007 17:57:10 -0700
Blocking is probably the worst socket model with regards
to extensibility (you need two threads per socket), async
is not necessarily the best model either - it requires single-
threaded execution and can bog down a server with
Windows messages. I'd suggest you limit the use of async
sockets to GUI applications. Alternative models to consider
are non-blocking via select, non-blocking via WSAEventSelect,
overlapped via events, and finally - overlapped via events
and I/O Completion Port. The last one is the best model
for a socket server. I'd stay clear of the overlapped via
completion routine model - it can lead to thread starvation
in servers, and unnecessarily complicates clients.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://vcfaq.mvps.org
=====================================
"Michael M." <nospam@xxxxxxxx> wrote in message
news:elOmtUwwHHA.484@xxxxxxxxxxxxxxxxxxxxxxx
.
- Prev by Date: Re: msgwaitformultipleobjects - loosing events ( i.e SetEvent - no eff
- Next by Date: Re: TCP server stop receiving new connections
- Previous by thread: Re: What is better Blocking Sockets or Async?
- Next by thread: Re: What is better Blocking Sockets or Async?
- Index(es):
Relevant Pages
|
Loading