The error code is actually contradictory (an operation on a .NET socket failing with "not a socket" error), but that's what the underlying OS reports. However, we'll at least try enhance our library to raise an exception with a more meaningful message in this case.