WSASend won't call the completion routine - Programmer
This is a discussion on WSASend won't call the completion routine - Programmer ; Hello. I'm writing a program that handles lots of tcp connections. Both outbound and inbound. I'm using a single thread to handle the IO on these sockets so, after looking around on MSDN, I decided to use WSASend and WSARecv ...
![]() |
| | LinkBack | Tools |
|
#1
| |||
| |||
| I'm writing a program that handles lots of tcp connections. Both outbound and inbound. I'm using a single thread to handle the IO on these sockets so, after looking around on MSDN, I decided to use WSASend and WSARecv as they support OVERLAPPED IO. Now I wrote a first function that uses WSASend to send bytes over sockets. As written on the docs sometimes it returns 0, in that situation I've the bytes send in a int that i give as an argument to the function. As predicted if I put a big buffer in it, it will return the WSA_IO_PENDING error that, as the docs say, means that the completion routine will be called. Now the problem is that in the latter situation the completion routine is not called at all. I receive correctly the WSA_IO_PENDING, but I don't receive a call. Data flows to the client, as I can see it, but I don't get the routine called at all. I noticed this because it doesn't touch a breakpoint I put at the beginning of the routine and it doesn't print a cout too. Did I misunderstood the semantics of this function? What may be the reasons for this? Moreover I've another doubt: will this function be called even if WSASend didn't return WSA_IO_PENDING?? I read it somewhere in the docs but I can't find it again (sorry...). |
![]() |
« Previous Thread
|
Next Thread »
| Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [PATCH 6/8] scsi: megaraid_sas - call cmd completion from reset | unix | Kernel | 0 | 10-07-2007 08:00 AM |
| RE: RE: Why the call instruction points 2 bytes before to the realstart sub-routine | unix | MS-DOS | 1 | 10-01-2007 04:24 AM |
| RE: RE: Why the call instruction points 2 bytes before to the realstart sub-routine ? | unix | MS-DOS | 1 | 10-01-2007 04:24 AM |
| RE: Why the call instruction points 2 bytes before to the real startsub-routine ? | unix | MS-DOS | 2 | 10-01-2007 04:24 AM |
| Why the call instruction points 2 bytes before to the real startsub-routine ? | unix | MS-DOS | 1 | 10-01-2007 04:24 AM |
All times are GMT. The time now is 08:20 AM.




