Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Timeout problem

 
Werner Fletcher
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2586
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Werner Fletcher
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2586
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What about my question? Are you using connection pooling?
 
Paul Clapham
Sheriff
Pie
Posts: 20969
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic