lib60870.NET icon indicating copy to clipboard operation
lib60870.NET copied to clipboard

SocketException error codes are not OS specific

Open nfp0 opened this issue 2 years ago • 0 comments

I was wondering why I was getting nonsensical SocketException error messages and I traced it back to his line:

https://github.com/mz-automation/lib60870.NET/blob/d291d38961816f8a56e757f7ff8e62e9482245f3/lib60870/CS104/Connection.cs#L1490C40-L1490C40

throw new SocketException(87); // wrong argument

The error code is hardcoded even though it is different among OSs. Error 87 is "Too many users" on Linux and "The parameter is incorrect." on Windows.

I was wondering why I was getting "Too many users" on Linux even though it was my 1st connection attempt.

nfp0 avatar Nov 17 '23 16:11 nfp0