Archived

This topic is now archived and is closed to further replies.

laeuchli

IOCP ports!

Recommended Posts

Do I have to use WSARecv with IOCP ports? Or can I use just normal recv? Cause I''m trying with normal recv, and it just isn''t working :-(.

Share this post


Link to post
Share on other sites
From what I''ve learned in the last few weeks, you have to use a function that understands overlapped I/O. WSARecv/WSASend are one way. The other way I have seen people do it is with WriteFile/ReadFile.

Hope that helps. There aren''t a ton of examples of IOCP out there yet.

-BlueNexus

Share this post


Link to post
Share on other sites
Once you make the call that creates the overlapped IO structure, the code to handle it is the same for commports, socket, & files. There will be differences in the functions called to handle the data once it''s completed, but the wating part is nearly identical for all three cases - so you can look at overlapped file io for examples (don''t look at the comm stuff, it''s poor code and usaully wrong).

I think there''s an article on GameDev about using IOCP''s as well, search ''em.

Magmai Kai Holmlor
- Not For Rent

Share this post


Link to post
Share on other sites