Re: IOCP and WSASend
From: Isaiass (isaiass_at_hotmail.com)
Date: 11/04/04
- Next message: Isaiass: "Re: WSAWaitForMultipleEvents supports only WSA_MAXIMUM_WAIT_EVENTS=64 events..."
- Previous message: Dave: "Re: network monitoring"
- In reply to: Konstantin Knyazev: "IOCP and WSASend"
- Next in thread: Alun Jones [MSFT]: "Re: IOCP and WSASend"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 4 Nov 2004 11:03:45 -0300
You should NOT process anything just after the function call in case of
success, only at GQCS...
What you should to check is whether the function has queued packet
successfully or it has failed:
if (WSASend(socket, ...) == SOCKET_ERROR) {
dwErr = WSAGetLastError();
if (dwErr != WSA_IO_PENDING) {
printf("WSASend failed for sock #%d with error code #%d\n", socket,
dwErr);
CleanUp(...); // close the socket and free all allocated resources
break; // continue, return etc
}
}
Isaiass
"Konstantin Knyazev" <kknyazev_no_spam_@mail.ru> wrote in message
news:eQiv%23AlwEHA.4040@TK2MSFTNGP11.phx.gbl...
> Hi!
>
> I'm using IOCP and WSASend to send data. But i'm a little confised, when i
> invoke WSASend i recieve result 0, i mean that data is sent and close
socket
> and free client resources, but on next GetQueuedCompletionStatus i'm
> recieving message about sending complete of closed socket and error raised
> due a client's data freed. Please, help me understand how to use WSASend
> when it return 0. I have not found any information about it in MSDN.
Thanks!
>
> Best regards, Konstantin Knyazev
>
>
- Next message: Isaiass: "Re: WSAWaitForMultipleEvents supports only WSA_MAXIMUM_WAIT_EVENTS=64 events..."
- Previous message: Dave: "Re: network monitoring"
- In reply to: Konstantin Knyazev: "IOCP and WSASend"
- Next in thread: Alun Jones [MSFT]: "Re: IOCP and WSASend"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|