VBNick 3 Junior Poster

I have read all the MSDN docs on this subject that seemed relevant, but I am still confused about a few things.

I am trying to achieve functionality like WSAAsyncSelect(), but use a separate thread instead of the main window. Can I use the regular WSAEventSelect() for this? and if I used WSAEventSelect() on the listenSocket for my server, would all the sockets produced from accept() also start triggering the same event that I selected for the listen socket? it doesn't say anything in the documentation WSAEnumNetworkEvents() about using more than one socket per event, and if there is any kind of queue for events.


My second question is, is there is any way to figure out which operation has just completed when you call GetQueuedCompletionStatus()? or do I have to store it and set/get all the information myself using the completion key each time?


My last question is which operations will trigger the completion port? The MSDN gave a list, but it was in terms of file operations. I would use these functions on overlapped sockets non-nonblocking sockets.

Is this list correct?
accept() -> triggered(for local client socket) when a client connects
recv() -> triggered when data has arrived
send() -> triggered when data sent successfully

should I even use EventSelect and completion ports in the same app, or use just one?

I know this will be a no-brainer for someone here.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.