-
Socket.setKeepAlive()?
Let's say I use this method in my online users list program as stated in the
previous post. If the client fails, e.g. connection loss, the socket that
was spawned from the ServerSocket to handle this thread will get a
SocketException right?
If this is the case, then I can possibly use this option to perform the
removal of the user from the online users list, isn't it?
Oh yeah, btw, should I use setKeepAlive() or getKeepAlive()?
Not to mention, is the socket setKeepAlive()=true as default? Or do I have
to explicitly setKeepAlive to true?
--
Best Regards,
Wing Hoe
---------------------------------------------------------------
ICQ: 2213281
Email: winghoe@hotmail.com
www: http://pwp.maxis.net.my/winghoe
---------------------------------------------------------------
-
Re: Socket.setKeepAlive()?
The best way to solve this situation is when your connection is established
between client and server provide some kind of protocol which tells the server
or client whether they are alive. You can set some time interval and set
up some kind of protocol which lets the client and serve know each other
still the connection is live.
"Lim Wing Hoe" <winghoe@hotmail.com> wrote:
>Let's say I use this method in my online users list program as stated in
the
>previous post. If the client fails, e.g. connection loss, the socket that
>was spawned from the ServerSocket to handle this thread will get a
>SocketException right?
>
>If this is the case, then I can possibly use this option to perform the
>removal of the user from the online users list, isn't it?
>
>Oh yeah, btw, should I use setKeepAlive() or getKeepAlive()?
>
>Not to mention, is the socket setKeepAlive()=true as default? Or do I have
>to explicitly setKeepAlive to true?
>--
>
>
>
>Best Regards,
>Wing Hoe
>---------------------------------------------------------------
>ICQ: 2213281
>Email: winghoe@hotmail.com
>www: http://pwp.maxis.net.my/winghoe
>---------------------------------------------------------------
>
>
>
>
>
>
>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks