It's not a secret anymore!*
The moose likes Java in General and the fly likes Client / Server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Client / Server" Watch "Client / Server" New topic

Client / Server

Kudret Serin
Ranch Hand

Joined: Aug 02, 2005
Posts: 167

I have a client/server application. The server serves to several clients at the same time. A client can close the connection with a special command. But i want that the connection is closed automatically by server when a client is not active for 10 second is.
How can i implement this?
Any help would be appreciated.
Wagner Danda Da Silva Filho
Ranch Hand

Joined: Mar 21, 2003
Posts: 80
What are you using as protocol? Sockets, RMI?

If sockets, you can set a timeout and force your client to disconect. See this article:
[ October 25, 2005: Message edited by: Wagner Danda ]

Kudret Serin
Ranch Hand

Joined: Aug 02, 2005
Posts: 167

That is it! Thanks a lot Wagner.
It is sorta covered in the JavaRanch Style Guide.
subject: Client / Server
Similar Threads
Transfer file from a client to server
Server/Client simple doubt
need help in handling HttpServletRequest
Communication between different protocols