When calling Socket.Select with lists that are verified to contain only Socket objects, I sometimes receive the error An operation was attempted on something that is not a socket. I can’t find a pattern for occurrence.
Socket.Select(readList, writeList, null, timeOut > 0 ? timeOut : 0);
It turns out the sockets were closed. That’s a really dumb error for .NET to be generating though just because of a closed socket.