Re: how to avoid recv() blocking issue?
- From: "Arkady Frenkel" <arkadyf@xxxxxxxxxxxxxxxx>
- Date: Tue, 7 Nov 2006 08:26:38 +0200
That strange because WSAEventSelect() as WSAAsyncSelect do set socket as
non-blocked. Check that you if you used them or through
ioctlsocket() with FIONBIO set to 1 on recv() you have to return with
WSAWOULDBLOCK warning or data
Arkady
"Alexander Cherny" <black@xxxxxxxxxxxxxxx> wrote in message
news:%23Wyf0XfAHHA.4292@xxxxxxxxxxxxxxxxxxxxxxx
hi all,
i got a problem with recv().
there's a thread to receive data from a server. periodically this thread
has to stop (to let others to do some work). i created some events to
check them inside the thread. the problem happens, when recv() starts and
does not receive any data from a server. this time the thread is stuck -
recv() just waits for data, and i can't stop the thread well (not using
TerminateThread() - btw, it's not a good idea, because a socket remains
"anchored" by the thread).
is there any way to "unblock" recv() somehow? WSAEventSelect() does not
help. looks like it's for different purposes.
thanks a lot.
--
alex c.
.
- Follow-Ups:
- Re: how to avoid recv() blocking issue?
- From: Alexander Cherny
- Re: how to avoid recv() blocking issue?
- From: Chris Becke
- Re: how to avoid recv() blocking issue?
- References:
- how to avoid recv() blocking issue?
- From: Alexander Cherny
- how to avoid recv() blocking issue?
- Prev by Date: how to avoid recv() blocking issue?
- Next by Date: Re: how to avoid recv() blocking issue?
- Previous by thread: how to avoid recv() blocking issue?
- Next by thread: Re: how to avoid recv() blocking issue?
- Index(es):
Relevant Pages
|