How can I set "send" to work in blocking mode. I have searched MSDN, but failed to find it.
Currently I use event object to block the thread, but feel not convenient.
Posted on 2003-09-28 00:21:42 by optimus
Don't call WSAEventSelect or WSAAsyncSelect
Posted on 2003-09-28 03:36:24 by greenant
But I don't know how to work with Winsock without calling these 2 API
Posted on 2003-09-28 04:54:17 by optimus
When you call these api you set your socket as nonblocking.
Use wsaeventselect and create an event, with CreateEvent, and then use standard windows wait functions (WaitForSingleObject, ...)
Posted on 2003-09-28 05:50:09 by greenant
It's either blocking or non-blocking, not blocking for sends and non-blocking for receives etc. But using an event and WaitForSingleObject you have pretty much the same behavior as blocking sockets.

Thomas
Posted on 2003-09-28 07:00:58 by Thomas
I will use event object in winsock programming in future. It really seems more convenient.
Posted on 2003-09-28 07:58:04 by optimus
event-based is nice. The windows messaging versions suck anyway. Go read www.madwizard.org , it's pretty nice.
Posted on 2003-09-28 08:55:06 by f0dder