• 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

Got error message "Connection reset by peer"

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I almost finish my project. I am working on the final testing right now. The design choice I chose is socket. It works fine while I used the Swing GUI client to perform the actions: e.g. bookSeat and search. In order to test my lock/unlock mechanism, I have a small bench program to run against with the multi-threaded server. The small bench program simply connect to the server and book record 1 by one seat. I use a for loop to spawn 5 threads to connect the server to perform the book seat
action. But sometimes I got the error messages:
Connection reset by peer: JVM_recv in socket input stream read
java.net.SocketException: Connection reset by peer: JVM_recv in socket input stream read
The design of my multi-thread server is as follows:
while(true)
{
Socket incoming = serverSocket.accept() ;
new Thread(new handle(incoming)).start() ;
}
As long as there's a new request incoming, the program spawns a new thread to handle the request (it means all the process would be in the run() method). I really can't figure out what the problem. If someone is also using the Socket approach, could you please give me some suggestions or advise? Thank you very much!!
Best Regards,
-PRELUDE
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic