• Register
Welcome to Kodlogs, programming questions and answer website.
0 votes

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)  

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)