Re: Need Help with IOCP
From: Brendan Rempel (brendan_at_n0sp4msonicmobility.com)
Date: 04/19/04
- Next message: Jason B: "DeleteUrlCacheEntry(url) function does not work for files downloaded in the subdirectory under “Temporary Internet Files\Contents.IE5” directory"
- Previous message: ColinHaldane: "Incoming/Outgoing Concurrent Connection Limit"
- In reply to: Brendan Rempel: "Re: Need Help with IOCP"
- Next in thread: Stanley Feng \(MSFT\): "Re: Need Help with IOCP"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 19 Apr 2004 12:46:21 -0600
Here's some more detail on what's going on:
struct linger li = { 0, 0 }; // Default: SO_DONTLINGER
int err;
err = setsockopt(m_Socket, SOL_SOCKET, SO_LINGER, (char *)&li, sizeof(li));
- err returns 0, success
err = shutdown(m_Socket, SD_BOTH);
- err returns 10057. Although this means that the socket is not connected,
it really is. The client side has not received notication that the
connection has been closed.
closesocket(m_Socket);
- the client immediately receives a network error and closes its connection
as this line executes.
Removing setsockopt call changes the return value of shutdown to -1
(undocumented return for shutdown). Adding while(Read) to any stage like
previously suggested also has no affect.
I found I can trick the incoming socket to start its completion routine by
calling WriteFileEx with zero bytes, however this hasn't made any change on
the outcome of the bug. If there's any suggestions, I would appreciate it
greatly.
Brendan
"Brendan Rempel" <brendan@n0sp4msonicmobility.com> wrote in message
news:u0r7K3hJEHA.1132@TK2MSFTNGP12.phx.gbl...
> Sibling as in part of the same list of sockets in the same list of IOCP
> threads. This is just a middle tier and when the server I connect to
closes
> a socket, I must close the connection to the client that connected to me.
>
> The problem is when this happens. I do get notified that the server has
> closed my outgoing connection and I can close my incoming connection.
> However, the client only gets partially notifed of the socket close. A
test
> program like telnet doesn't care, but Internet Explorer will abort and
show
> an error. According to a packet sniffer, only about half of the TCP ACKs
> are being transmitted either way which is tricks clients into thinking
> there's a network error. All the payload data does get transmitted.
<clip>
- Next message: Jason B: "DeleteUrlCacheEntry(url) function does not work for files downloaded in the subdirectory under “Temporary Internet Files\Contents.IE5” directory"
- Previous message: ColinHaldane: "Incoming/Outgoing Concurrent Connection Limit"
- In reply to: Brendan Rempel: "Re: Need Help with IOCP"
- Next in thread: Stanley Feng \(MSFT\): "Re: Need Help with IOCP"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|