WSARecv Problems.

Started by
9 comments, last by laeuchli 22 years, 3 months ago
quote:
Er, he never creates an event to use for overlapped I/O, nor creates a completion port, nor creates a completion port and an event, nor gives it a completion routine... so I don''t see how it would ever work... _unless it''s a blocking socket.


You sound in a bad mood lately Mag...work getting to you or something?

Just thought I''d point out that when using overlapped I/O with I/O completion ports, you don''t create an event. I think you are mixing up WSAWaitForMultipleEvents/WSAGetOverlappedResult with I/O completion ports. Also, you don''t create an event in the OVERLAPPED data structure when using completion callbacks. The hEvent parameter is ignore when you request a callback.

Lastly, I would also assume that he created the I/O completion port object in another section of code.

When a program works in debug mode but not in release it is usually some stupid memory bug like a buffer overflow. For instance, I once had a buffer and a socket variable (int) stored closely together in memory. I was writing past my buffer and into my socket variable''s memory space which ended up changing the socket handle number. This obviously caused remaining calls to fail with "Not a socket." This didn''t show in debug because I had extra padding added after each variable to test for overwrites (custom memory management.) So even though the bug occurred in debug, it didn''t overwrite anything because of the padding. At least the custom memory manager caught it.

Dire Wolf
www.digitalfiends.com
[email=direwolf@digitalfiends.com]Dire Wolf[/email]
www.digitalfiends.com

This topic is closed to new replies.

Advertisement