• 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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Socket Server crashing after sometime

Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a socket server which has to be running always.
It accepts connections from various clients and creates a thread for each connection to process the data nad save to database.
In each thread created for a connection, the data is read from a buffered input stream and processed.
The program runs well for half a day. There are 2 scenarios observed after some runs.

1) But due to some reason, the server stops listening to requests and there are no data updates in database.
At this point, if i try to simulate a client, the client gets connection refused exception.
On server machine, the server process is still running and processing data for a different client (lets name this as STILLRUNNING_CLIENT).
No new clients are able to connect and once STILLRUNNING_CLIENT disconnects due to network issue, it will also not be able to connect.

2) Server stops running and the process list on the machine does not show socket server process as running.

Please suggest what could be the reasons causing these crashes.
Skool. Stay in. Smartness. Tiny ad:
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic