Re: [twsocket] about the socket close

2006-02-09 Thread Francois Piette
> > To send a FIN to the remote site, you have to call Shutdown, not Close.
> > When the remote acknoledge
> > the end of connection, you get the OnSessionClosed event triggered.

> Thanks for Francois.Following your words,when the server don't call the
> 'shutdown()',does it mean that the second FIN can't be sent to client,even
> if it has received the client's FIN?

Either party (client or server) can call Shutdown to gracefully terminate the 
connection. Winsock
does the sequence you described and both parties receive the OnSessionClosed 
event.

--
Contribute to the SSL Effort. Visit
http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] about the socket close

2006-02-09 Thread Jeff Peng
Sorry for having sent the same message to this list two times.

Thanks for Francois.Following your words,when the server don't call the
'shutdown()',does it mean that the second FIN can't be sent to client,even
if it has received the client's FIN?


2006/2/9, Francois Piette <[EMAIL PROTECTED]>:
>
> I'm not sure I understand...
> To send a FIN to the remote site, you have to call Shutdown, not Close.
> When the remote acknoledge
> the end of connection, you get the OnSessionClosed event triggered.
>
> --
> Contribute to the SSL Effort. Visit
> http://www.overbyte.be/eng/ssl.html
> --
> [EMAIL PROTECTED]
> Author of ICS (Internet Component Suite, freeware)
> Author of MidWare (Multi-tier framework, freeware)
> http://www.overbyte.be
>
>
>
> - Original Message -
> From: "Jeff Peng" <[EMAIL PROTECTED]>
> To: 
> Sent: Thursday, February 09, 2006 11:44 AM
> Subject: [twsocket] about the socket close
>
>
> > hello,list,
> >
> > I have a pair of Client-Server Socket programs.When the client have
> finished
> > writing the datas,it should call the 'close()' to close the socket-end
> for
> > client.And,when the server receive the EOF coming from client,it should
> call
> > the 'close()' the close socket-end for server.Then the established
> socket
> > between client and server should be freed.
> >
> > As we know,the close behavier under tcp socket is shown as below:
> >
> >  *  Client   --->  FIN  --->  Server*
> >
> > *   Client   <---  ACK  <---  Server*
> >
> > *   Client   <---  FIN  <---  Server*
> >
> >*Server   --->  ACK  --->  Client*
> >
> > **
> >
> > *The question I want to know is,when the 'close()' call happened,if it
> > should generate a 'FIN' and send it to another end?If it's true,then at
> the
> > server end,when it receive the 'EOF' coming from client,it can delay for
> > some time to call 'close()',so the 'FIN' should not be sent to client
> > immediately,is it?*
> >
> > *Thanks for replies.*
> >
> > **
> >
> > **
> >
> > *Jeff*
> > --
> > To unsubscribe or change your settings for TWSocket mailing list
> > please goto http://www.elists.org/mailman/listinfo/twsocket
> > Visit our website at http://www.overbyte.be
>
> --
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be
>
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] about the socket close

2006-02-09 Thread Francois Piette
I'm not sure I understand...
To send a FIN to the remote site, you have to call Shutdown, not Close. When 
the remote acknoledge
the end of connection, you get the OnSessionClosed event triggered.

--
Contribute to the SSL Effort. Visit
http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be



- Original Message - 
From: "Jeff Peng" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, February 09, 2006 11:44 AM
Subject: [twsocket] about the socket close


> hello,list,
>
> I have a pair of Client-Server Socket programs.When the client have finished
> writing the datas,it should call the 'close()' to close the socket-end for
> client.And,when the server receive the EOF coming from client,it should call
> the 'close()' the close socket-end for server.Then the established socket
> between client and server should be freed.
>
> As we know,the close behavier under tcp socket is shown as below:
>
>  *  Client   --->  FIN  --->  Server*
>
> *   Client   <---  ACK  <---  Server*
>
> *   Client   <---  FIN  <---  Server*
>
>*Server   --->  ACK  --->  Client*
>
> **
>
> *The question I want to know is,when the 'close()' call happened,if it
> should generate a 'FIN' and send it to another end?If it's true,then at the
> server end,when it receive the 'EOF' coming from client,it can delay for
> some time to call 'close()',so the 'FIN' should not be sent to client
> immediately,is it?*
>
> *Thanks for replies.*
>
> **
>
> **
>
> *Jeff*
> -- 
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be