SocketConnector shutdown

Please post support and help requests here.
Posts: 18
Joined: 20 Mar 2007, 14:08

SocketConnector shutdown

Postby Amine » 21 May 2007, 16:34

When a SocketConnector object is deleted, is the StreamSocket inside shuted down ?

Posts: 1268
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: SocketConnector shutdown

Postby guenter » 21 May 2007, 19:04

Short answer: No
Long answer: SocketImpl objects (which are the actual socket objects behind Socket, StreamSocket, etc.) are reference counted. As soon as the last Socket object referencing a SocketImpl goes away, the SocketImpl is destroyed and the socket it holds is closed. Closing a stream socket involves shutting down the socket. So, if the SocketConnector is the only one holding a reference to the StreamSocket, then, yes, the StreamSocket is closed and thus shutdown.

Posts: 18
Joined: 20 Mar 2007, 14:08

Re: Re: SocketConnector shutdown

Postby Amine » 22 May 2007, 12:53

ok thank you for your answer. It is good to know !
I have another question: I am using SocketAcceptor + SocketReactor for a server program, and in the server side when I shutdown the socket, the server receives a ReadableNotification with 0 bytes and did not receive a ShutdownNotification. do you have an explanation for this ?

Thank you for helping me.

Return to “Support”

Who is online

Users browsing this forum: No registered users and 3 guests