I created a blocking socket and opend a port . The port sends with send() a welcome message. This works fine, but i have problems receiving data from the other site. Do i have to use select() first, when i want to use receive() ?

Posted on 2002-02-13 15:23:21 by belial
the WSAAsyncSelect fuction should solve your problem. its designed to "request Windows message-based notification of network events for a socket". you should invoke this function right after you create your socket.

if you just want to receive information the function would look something like this:

invoke WSAAsyncSelect,hSocket0,hWin, Event, FD_READ

note: there are many other notification events that you can use too take a look at the msdn.

then you will need to intercept the special notification event you created in your window proc. it will look something like this:

.ELSEIF uMsg == Event

mov eax, lParam
.if ax==FD_READ
;do something such as receive the information
Posted on 2002-02-13 16:08:38 by smurf