Sign in to follow this  
blueone

IOCP disaster

Recommended Posts

Since last week, i focus on searching over google on how to implement this thing (IOCP - Input/Output Completion Port). This strange feeling i cant explain while trying hard to get the idea on how to make it work is really bad. I even think of it till I sleep on how im going to make it work. So, this what i am going to ask. Please respect my ignorance about this thing. ;) How can I start a iocp winsock program? Dont worry, ive already done some BASIC winsock programs like sending and recieving messages between two computers via TCP and UDP so I could get the idea easily. Ive also read the Microsoft's "Windows Sockets 2.0: Write Scalable Winsock Apps Using Completion" and downloaded it's code but the OVERLAPPEDPLUS class isnt defined. Also several classes from other websites but they are so messy. All i need is how im going to do this. WSAStartup(514 or MAKEWORD(2,2),&wsadata); ---I already knew this sock = WSASocket(AF_INET, SOCK_STREAM, 0, NULL, 0, WSA_FLAG_OVERLAPPED); --- =) ?????? i dunno whats next sending and receiving also T_T closesocket(sock); ROFL Any winsock skilled one please help me! im suffering serious stress!

Share this post


Link to post
Share on other sites
Here's my recommendation for you to make progress on your project (assuming your project is something larger than just "learn IOCP with WinSock"):

Use select(), or another simple socket multiplexer (maybe even WSAAsyncSelect()) to get your project working. The benefits of IOCP only come in under very heavy client load and when you structure the entire application to take advantage of that specific programming model. It does not sound as if that's something you need to solve right now.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this