my dog learned polymorphism*
The moose likes Sockets and Internet Protocols and the fly likes Client disconnected from server after about 10 minutes of inactivity 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 » Sockets and Internet Protocols
Bookmark "Client disconnected from server after about 10 minutes of inactivity" Watch "Client disconnected from server after about 10 minutes of inactivity" New topic
Author

Client disconnected from server after about 10 minutes of inactivity

john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

My client is disconnected from the server after about 10 minutes of inactivity. Why is this? I do not have anything in my code that does that. The program stays up, but the connection between the client and server is lost. Why is this and how can I fix it?
NOTE: My client code is over 1k lines long, so you probably don't want me posting that. It hopefully is just a general problem that can be fixed...
Server code:

Thanks,
cc11rocks aka John Price


“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” (Mosher's Law of Software Engineering)
“If debugging is the process of removing bugs, then programming must be the process of putting them in.” (Edsger Dijkstra)
john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

Fine...
Server code:

Would this fix the problem?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19651
    
  18

Possibly. The best way to find out is to try it out.
(And I'm not just saying this to avoid giving the answer - I just don't know for sure.)


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

I tried it...It didn't work. I found a work-around, but I am sure there is something I can do. I shouldn't have to use the workaround...
The workaround I am doing is setting off a "fake" message to keep it inactive. This will not do when I distribute...
Thanks,
cc11rocks aka John Price
john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

BUMP and Change.
I meant to say "to keep it active" instead of "to keep it inactive".
John Price aka cc11rocks
john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

I had to go into Windows to fix this:
Control Panel > Installed Updated > Turn Windows Features on or Off > (CheckBox) Simple TCPIP services (i.e. echo, daytime etc)
Works like a charm now.
cc11rocks aka John Price
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Client disconnected from server after about 10 minutes of inactivity
 
Similar Threads
Head First Java Chapter 15 Questiion
Help with Chat software
Help with this "ready-bake code", implementing Runnable
ServerSocket to SSL
85 line program...wondering if it's possible to do in Applets