Programmers learn & share
0 votes
79 views

Problem :

I am trying to implement an HTTP Server using Sockets but getting bellow error

java net socketexception connection reset by peer socket write error

by (6.9k points)   | 79 views

1 Answer

0 votes

Solution :

1. It happens when TCP socket is about to "close" but your  code is not yet notified.

2. You already must have written throws  IOException and SocketException extends IOException.

3. You just need to properly handle IOException because it is a normal part of the api.

Further Readings:

by (36.1k points)  
2,183 questions
2,488 answers
59 comments
241 users