Advertisement

IOCP disaster

Started by June 06, 2006 07:15 AM
1 comment, last by hplus0603 18 years, 8 months ago
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!
http://members.gamedev.net/cbenoi1/iocp_udp.zip ( Clicky ).

-cb
Advertisement
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.

enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement