I am rewriting the client side of an existing C++ application to be C#. The server application will remain written in C++. The communication is working properly all the way until the end, where the Server closes the socket. The architecture is as follows and uses Async send and receive: Client: Send Data to Server Server: Receive Data from Client Server: Send data (files) to Client Server: Close Socket Client: Receive Data from Server
In the old C++ version of the program, the data is already on the socket and even though one side of the socket connection closes, the data is still available. From my undertanding in C#, once half of the connection closes, a reset connection packet is sent and the C# gets an exception, which prevents me from receiving the rest of the data. (I am only receiving 1 file instead of 2 since the socket is closed by the server after it sends the information).
I can post my code, but it really is just a simple Async Send and Receive. If i step through the code and pause right before the socket close function of the server, everything works as expected. The actual Exception error is "An existing connection was forcibly closed by the remote host."