Run windows programs on mac mono
SocketException.SocketErrorCode returns a value from the SocketError enum.
#Run windows programs on mac mono code#
In the IBM Knowledge Center, we can find a few more values for the connection refused error code from the Unix world (also known as ECONNREFUSED):įor a better understanding of what’s going on, let’s check out the source code of all the properties.
NET Core returns 61 for ErrorCode and NativeErrorCode. Here, Mono is completely Windows-compatible again, but. NET Core is different: it returns a Windows-compatible value for SocketErrorCode (10061) and a Linux-like value for ErrorCode and NativeErrorCode (111). NET Core:ġ0061 corresponds to the code of the connection refused socket error code in Windows (also known as WSAECONNREFUSED).Īs you can see, Mono returns Windows-compatible error codes. If we run it on Windows, we will get the same value on. Var se = new SocketException((int) SocketError.ConnectionRefused) Ĭonsole.WriteLine((int)se.SocketErrorCode) Let’s start with the following program, which prints error code property values for SocketError.ConnectionRefused: NET Core? Let’s figure it all out! Digging into the problem What’s the difference between these properties? Should we expect different values on different runtimes or different operating systems? Which one should we use in production? Why do we have problems with ShouldRetr圜onnection on.
How Socket Error Codes Depend on Runtime and Operating System.
#Run windows programs on mac mono series#
There’s too much to share in one post, so we will make this into a series of posts. By sharing our experiences, we hope to help out those who are in the same boat. This post is the first part of a blog post series that covers different technical challenges that we had to resolve during the migration of the Rider backend process from Mono to.
Writing cross-platform socket error handling.