There is no corresponding option in Linux to tell the network connection report "connection reset" or not. Maybe the closest thing you can do is to catch SocketException. I'm not sure if .NET Core runtime will translate the error number in Linux to error code because the error code between TCP and UDP connection in Linux is different (Seems "Connection reset" is -18 for UDP and 104 for TCP).
Socket.IOControl method is not supported on Linux platform
Hi,
I have one .Net Core 3.1 console application in which Socket.IOControl method used.
When running at linux server(RedHat),it is getting error at runtime.
Please find the below code,
Code:
Socket m_Socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
m_Socket.Bind(new IPEndPoint(m_OriginAddressIP, m_iPort));
m_Socket.IOControl((IOControlCode)SIO_UDP_CONNRESET, new byte[] { 0, 0, 0, 1 }, null);
Error:
"Socket.IOControl handles Windows specific control codes and not supported on linux platform"
How to solve this error in linux?