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

Exception when call Server.Stop()

Open Tivaty opened this issue 2 years ago • 1 comments

Hello, I catch this exception all the time, when server has connection or no connection to client. it is from the line of listeningSocket.Shutdown(SocketShutdown.Both);

the server is turned off but exception is still happen at this line. Please support to check and update. Thank you.

`System.Net.Sockets.SocketException HResult=0x80004005 Message=A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied. Source=System.Net.Sockets StackTrace: at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName) at System.Net.Sockets.Socket.Shutdown(SocketShutdown how) at lib60870.CS104.Server.Stop() in D:\work\C#\iec104\lib60870.NET\lib60870\CS104\Server.cs:line 943

This exception was originally thrown at this call stack: [External Code] lib60870.CS104.Server.Stop() in Server.cs`

Tivaty avatar Jun 26 '23 11:06 Tivaty

This is another issue addressed in https://github.com/juwiefer-btc/lib60870.NET.

@mzillgith: You might want to skim through the diff to see the issues I have addressed. I could even create a pull request, but I guess my coding style might not fit in very well.

juwiefer-btc avatar Jun 26 '23 11:06 juwiefer-btc