Please note, I do not know about Raspberry Pi, so this might not be of much help but will give some ideas:
On Windows this could happen:
- when the server is listening on a different port.
- when the server's IP address changes due to a DHCP reallocation. Also is the client PC changing the IP and the Raspberry pi server expects a particular client ip?
- due to a firewall
- due to proxy mode on the server's connection
- due to timing issues
- due to other program listening to the same port
- due to not enough permissions.
This is a link I found that also gives some relevant explanation.