• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Got error message "Connection reset by peer"

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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
 
I am not a spy. Definitely. Definitely not a spy. Not me. No way. But this tiny ad ...
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic