1

Topic: RST on the client after socketclose on the server

Greetings, the Client and the server communicate on the simple protocol: - client sends request send () send () shutdown (SHUT_WR) - starts waiting for a reply read ()... - server accepts conn and reads request read ()... send (). - writes reply closesocket () - and immediately closes its socket Thus the client after closesocket () on the server periodically receives RST. In my understanding, it means that on the server in recv queue the unread data still lies. But: 1. If before socketclose () on the server to make recv () he reads 0 byte. 2. The problem transits, if before closesocket () on the server to cause shutdown (SHUT_BOTH). How it is possible to explain such behavior? Platform Win 7. SO_linger .

2

Re: RST on the client after socketclose on the server

Hello, tdiff, you wrote: T> Thus the client after closesocket () periodically receives RST. In my understanding, it means that on the server in recv queue the unread data still lies. But: Whence you know, what the client after closesocket () receives?

3

Re: RST on the client after socketclose on the server

Hello, Pzz, you wrote: Pzz> Hello, tdiff, you wrote: T>> Thus the client after closesocket () periodically receives RST. In my understanding, it means that on the server in recv queue the unread data still lies. But: Pzz> Whence you know, what the client after closesocket () receives? Unfortunately, I do not have possibility to launch Wireshark, but the client (it is written on c#) quits from Receive with error = SocketError. ConnectionReset.

4

Re: RST on the client after socketclose on the server

Hello, tdiff, you wrote: T> Unfortunately, I do not have possibility to launch Wireshark, but the client (it is written on c#) quits from Receive with error = SocketError. ConnectionReset. You SO_LINGER touched?

5

Re: RST on the client after socketclose on the server

Hello, Pzz, you wrote: Pzz> Hello, tdiff, you wrote: T>> Unfortunately, I do not have possibility to launch Wireshark, but the client (it is written on c#) quits from Receive with error = SocketError. ConnectionReset. Pzz> You SO_LINGER touched? No

6

Re: RST on the client after socketclose on the server

reset comes to the client? Means on the server before  it is necessary delivers

7

Re: RST on the client after socketclose on the server

Hello, reversecode, you wrote: R> reset comes to the client? Means on the server before  it is necessary I delivers   it and I do, but I do not understand that happens. How shutdown wr protects from rst?

8

Re: RST on the client after socketclose on the server

At you it is very badly painted that you do about that that you do to the server I do not see, 1) 2) I so understood hints concern the client?  http://cs.ecs.baylor.edu/~donahoo/pract … TCPRST.pdf

9

Re: RST on the client after socketclose on the server

Hello, reversecode, you wrote: R> at you it is very badly painted that you do R> about that that you do to the server I do not see, 1) 2) I so understood hints concern the client? R>  R> http://cs.ecs.baylor.edu/~donahoo/pract … TCPRST.pdf http://cs.baylor.edu/~donahoo/practical … lientRST.c http://cs.baylor.edu/~donahoo/practical … hoServer.c completely the code what is more clear

10

Re: RST on the client after socketclose on the server

Hello, reversecode, you wrote: R> at you it is very badly painted that you do R> about that that you do to the server I do not see, 1) 2) I so understood hints concern the client? R>  R> http://cs.ecs.baylor.edu/~donahoo/pract … TCPRST.pdf and, I understood that badly wrote (updated the description). In my situation the socket the first closes the server (causes closesocket). During this moment the client hangs on recv (). Accordingly, rst the client as receives an error from recv. Hints 1 and 2 concern the server. Article already saw, but from it it is not clear, why it works.

11

Re: RST on the client after socketclose on the server

On the server there is a queue, sometimes if to make  a socket that it seeing not processed queue sends   but even if having not processed entering queue, to make the clown  that I think (it is necessary to look  ) or 1) the channel  and is closed at the client, and  which the server the client  can already send or 2) the server seeing that extinguished record, any more does not send  from for that that there is not processed queue in a socket

12

Re: RST on the client after socketclose on the server

Hello, tdiff, you wrote: Pzz>> You SO_LINGER touched? T> there is no very much all it looks strange. If on the server recv () returned the zero, means, all already , and it is not expected any more (the server realized that the client made shutdown () on record). And you completely supervise a socket, or there is still any code which with it something can make?

13

Re: RST on the client after socketclose on the server

The variant 2 looks logical), there is no sense to push  if has already been sent  from the clown

14

Re: RST on the client after socketclose on the server

Hello, reversecode, you wrote: R> at you it is very badly painted that you do All at it is well painted R> http://cs.ecs.baylor.edu/~donahoo/pract … TCPRST.pdf At it recv () returned 0. Means, all data already , and socket closing on record .

15

Re: RST on the client after socketclose on the server

Hello, reversecode, you wrote: R> on the server there is a queue, sometimes R> if to make  a socket that it seeing not processed queue sends   R> but even if having not processed entering queue, to make the clown  R> that I think (it is necessary to look  ) R> or R> 1) the channel  and is closed at the client, and  which the server the client  R> can already send or R> 2) the server seeing that extinguished record, any more does not send  from for that that there is not processed queue in a socket , thanks. I approximately so assumed, but anywhere did not see the docks, confirming it. I still had misunderstanding why read before close on the server returns a zero? I.e. queue is not present. Unless I could not read yet EOF, for example...

16

Re: RST on the client after socketclose on the server

Block or  the unit the server? It is necessary to look   that there,  or what that another error status code at zero obtaining it is necessary to look, though I  as there in  if there was an error always was ? Or it is necessary to check manually sometimes?

17

Re: RST on the client after socketclose on the server

Hello, tdiff, you wrote: T> I still had misunderstanding why read before close on the server returns a zero? I.e. queue is not present. Unless I could not read yet EOF, for example... When read returns 0, it and is EOF

18

Re: RST on the client after socketclose on the server

Hello, Pzz, you wrote: Pzz> very much all it looks strange. If on the server recv () returned the zero, means, all already , and it is not expected any more (the server realized that the client made shutdown () on record). Pzz> And you completely supervise a socket, or there is still any code which with it something can make? Completely itself, short of any DLP, but it already absolutely esoterics

19

Re: RST on the client after socketclose on the server

Hello, reversecode, you wrote: R> block or  the unit the server? R> it is necessary to look   that there,  or what that another R> error status code at zero obtaining it is necessary to look, though I  as there in , R> if there was an error always was ? Or it is necessary to check manually sometimes? At me the client on , the server on pluses. He absolutely unpretentious - creates on  on each connection, all sockets locked. Since all this beauty works under Windows, recv = 0 means the end  without an error. TCP dump it is almost inaccessible

20

Re: RST on the client after socketclose on the server

Zero  in a locking socket this closing of connection in non-blocking it is necessary to look still an error T> TCP dump is almost inaccessible we not in the Stone Age    a heap  under Windows  in Google

21

Re: RST on the client after socketclose on the server

Hello, tdiff, you wrote: T> TCP dump it is almost inaccessible I Am possible to you I will go I will work?

22

Re: RST on the client after socketclose on the server

Hello, reversecode, you wrote: R> we not in Stone Age R>    a heap  under Windows  in Google I know, but in our office very strict relation to such software.