My nightmare returns...
See original GitHub issueHello. It would appear that I’m doing something wrong (Once more)
I believe that the client gets disposed at some point after receiving a long byte[] from remote connections… I have checked with the client.test and server.test those work perfectly fine. I’m just doing something wrong in my own implementation of the package… How can I move the client and the server networking to a separate class and instantiate it ?(You talked to me about this before) Do I need to use the { get; set; } ? This issue has me really confused, I’m sure that my router network works fine, I’m just doing something wrong in the code… It used to work fine for small byte[] but when I try to send a .wav file for example it just disposes itself or something like that… I get the following error:
Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.
Edit: Here are the full errors in both exception and .json formats.
[ERROR] System.IO.IOException: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size) --- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size) at WatsonTcp.WatsonTcpServer.SendDataStream(ClientMetadata client, Int64 contentLength, Stream stream) at WatsonTcp.WatsonTcpServer.SendInternal(ClientMetadata client, WatsonMessage msg, Int64 contentLength, Stream stream)
"ClassName": "System.IO.IOException", "Message": "Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.", "Data": null, "InnerException": { "NativeErrorCode": 10054, "ClassName": "System.Net.Sockets.SocketException", "Message": "An existing connection was forcibly closed by the remote host", "Data": null, "InnerException": null, "HelpURL": null, "StackTraceString": " at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)\r\n at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)", "RemoteStackTraceString": null, "RemoteStackIndex": 0, "ExceptionMethod": "8\nSend\nSystem, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\nSystem.Net.Sockets.Socket\nInt32 Send(Byte[], Int32, Int32, System.Net.Sockets.SocketFlags)", "HResult": -2147467259, "Source": "System", "WatsonBuckets": null }, "HelpURL": null, "StackTraceString": " at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)\r\n at WatsonTcp.WatsonTcpServer.SendDataStream(ClientMetadata client, Int64 contentLength, Stream stream)\r\n at WatsonTcp.WatsonTcpServer.SendInternal(ClientMetadata client, WatsonMessage msg, Int64 contentLength, Stream stream)", "RemoteStackTraceString": null, "RemoteStackIndex": 0, "ExceptionMethod": "8\nWrite\nSystem, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\nSystem.Net.Sockets.NetworkStream\nVoid Write(Byte[], Int32, Int32)", "HResult": -2146232800, "Source": "System", "WatsonBuckets": null
Edit2: These errors specifically happen when sending large byte[] with the Server.Send(IpPort, byte[]) method
Edit3: I looked a bit more into it, I believe that this could be caused by “IpPort” mismatches, like, the server sends data to a port the client doesn’t expect to receive them from? I noticed that more ports than the one initially set up as the actual port to use are being used to send/receive data
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top GitHub Comments
I’m sorry but the newest version completely bricked my app… I moved on to a different package and cross-network communication works too. I’m sorry @jchristn , I waited ~4 days I understand you had alot to work with and that’s okay
Hi @Antwns if you invite me to your repo, I’ll be happy to clone, take a look, and contribute recommendations.