I have a client and server, based on TcpListener
and TcpClient
. The client connects to the server and they exchange some data. Everything works just fine when I run locally.
But when I put the server in a Docker container on Azure Container Services, and connect the client to it, the following happens:
- Client connects successfully to server
- Client and server perform successful handshake
- Data transfer begins
- Approximately 20 seconds later (this is supposed to take several minutes) the whole thing blows up. The server reports "connection reset by peer" and the client reports "error reading past the end of the stream."
Each side seems to think the other side is the one with the problem. When I'm running locally, everything works as expected, which leads me to believe that the problem is somewhere in between.
There isn't a fundamental issue with establishing the connection, such as a firewall getting in the way, because I've verified at both ends that they're connecting and performing the handshake. The client is not "slamming the phone down"; it's expecting more data from the server. But "connection reset by peer" means that someone somewhere is intentionally sending a RST packet.
Is there any good way to figure out what's interfering with my data transfer?