java.net.ConnectException: Connection refused

This exception means that there is no service listening on the IP/port you are trying to connect to: You are trying to connect to the wrong IP/Host or port. You have not started your server. Your server is not listening for connections. On Windows servers, the listen backlog queue is full.

What does “connection reset by peer” mean?

It’s fatal. The remote server has sent you a RST packet, which indicates an immediate dropping of the connection, rather than the usual handshake. This bypasses the normal half-closed state transition. I like this description: “Connection reset by peer” is the TCP/IP equivalent of slamming the phone back on the hook. It’s more polite than merely … Read more

Why is it not possible to fake an IP address?

It is fully possible to send data with a fake sender IP. You’ll have a hard time getting replies though, since the replies will be sent to the fake IP and never reach you. Additionally, if you send data with a “from” IP that a router doesn’t expect to arrive from you, the router will … Read more