You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use a package, CoreRCON, which allows me to connect to Source Game Servers to remotely send console commands. On start, my app creates the connections to the servers, and stores them for later. The problem is, one of the rcon server connection throws a System.IO.InvalidDataException on my Debian server, but testing on my Windows PC, no error is thrown. Trying to catch the exception in a try-catch statement doesn't work.
I think this is a bug in CoreRCON. It assumes that its TCPPacketReceived method will be called for every "packet". But TCP is a stream-based protocol, it does not really have packets (or rather, it uses packets only as an implementation detail), you can't assume that the buffer you receive contains exactly the information you want, not more or less, as is explained in the documentation:
For byte stream-style sockets, incoming data is placed into the buffer until the buffer is filled, the connection is closed, or the internally buffered data is exhausted.
If it seems to work reliably on Windows, then that's probably just luck.
And CoreRCON is also the reason why the exception is uncatchable: it's thrown from TCPPacketReceived, which is the event handler for SocketAsyncEventArgs.Completed. As far as I know, if the handler throws an exception (and doesn't handle it itself), you can't catch it.
Sounds like @svick has helped conclude there is nothing here to fix in .NET Core. If it gets root caused as an issue in the platform, let us know. I'm going to close this for now.
Heya,
I use a package, CoreRCON, which allows me to connect to Source Game Servers to remotely send console commands. On start, my app creates the connections to the servers, and stores them for later. The problem is, one of the rcon server connection throws a
System.IO.InvalidDataException
on my Debian server, but testing on my Windows PC, no error is thrown. Trying to catch the exception in a try-catch statement doesn't work.Exception: https://hastebin.com/eyibotehup.css
Server: Linux botsrv 4.5.7-std-3 #1 SMP Tue Jul 12 09:56:30 UTC 2016 x86_64 GNU/Linux
Result on Server:

Result on PC:

The text was updated successfully, but these errors were encountered: