• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Timeout problem

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What about my question? Are you using connection pooling?
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!
 
You firghten me terribly. I would like to go home now. Here, take this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic