aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes Timeout problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Timeout problem" Watch "Timeout problem" New topic
Author

Timeout problem

Werner Fletcher
Ranch Hand

Joined: Apr 19, 2011
Posts: 34
Hey guys,

Just a quick one... I made a chat program. Everything works fine except one thing. If the connection between the server and the client stays idle for a while, it times out.
"Software caused connection abort: recv failed"

Is there any way I can avoid this problem?
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2516
    
  10

Are you using connection pooling? In that case, it may have an option to validate if a connection is good, before it is given to your application.


OCUP UML fundamental and ITIL foundation
youtube channel
Werner Fletcher
Ranch Hand

Joined: Apr 19, 2011
Posts: 34
Jan Cumps wrote:Are you using connection pooling? In that case, it may have an option to validate if a connection is good, before it is given to your application.


I actually can't pinpoint if the problem is with the socket or the connection. I think it would just be easier to implement a "polling" thread that constantly pings the connected clients?
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2516
    
  10

What about my question? Are you using connection pooling?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18988
    
    8

Jan, you seem to be under the impression that Werner is asking a question about JDBC. It's true that the post is in the JDBC forum, from which you might reasonably expect it to be about JDBC, but if you read what Werner wrote, the question actually appears to be about the operation of his chat program.

So given that the question doesn't seem to have anything to do with JDBC, I'm going to move it elsewhere.
Werner Fletcher
Ranch Hand

Joined: Apr 19, 2011
Posts: 34
Jan Cumps wrote:What about my question? Are you using connection pooling?


My apologies. No I am not using pooling. I create a new connection for each client that connects to the server.
Werner Fletcher
Ranch Hand

Joined: Apr 19, 2011
Posts: 34
Nobody at all?

I am on the verge of breaking something!! This sql connection keeps on timing out when idle. I have even made a thread that polls the database AND the chat server but it still happens. Is there ANY other way of keeping this freaking thing alive??
HELP ME PLEASE!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Timeout problem