Overview
Features
Download
Documentation
Community
Add-Ons & Services

SocketConnector shutdown

Please post support and help requests here.

SocketConnector shutdown

Postby Amine » 21 May 2007, 16:34

When a SocketConnector object is deleted, is the StreamSocket inside shuted down ?
Amine
 
Posts: 18
Joined: 20 Mar 2007, 14:08

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.
guenter
 
Posts: 1107
Joined: 11 Jul 2006, 16:27
Location: Austria

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.
Amine
 
Posts: 18
Joined: 20 Mar 2007, 14:08


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron