Checkin in again. I noticed the SetBlocking function has been added, so I've decided to give it another go.
So I SetBlocking(false) on a listener tcp socket, on the port I'm interested in. The problem now seems to be that SocketTCP::Accept doesn't return anything special to designate that there is no pending connection.
I would expect that when a non blocking listener socket is listening on a port, that each frame you can poll any pending connections and create them. At that point you'd have a SocketTCP for the clients connection, seperate of the listener socket. I presume that works if you use blocking sockets, but the non blocking socket support is incomplete in that regard, unless I'm missing something.
Calling SocketTCP.Accept on the non blocking listener socket right after Listen seems to return a normal error code(Done) as if it actually accepted a new connection immediately. I expect an immediate return, being non blocking, but how is the user expected to know when new client connections are opened?
Edit: Debugging a bit, it appears the problem is due to the
SetBlocking(true);
in the constructor SocketTCP::SocketTCP(SocketHelper::SocketType Descriptor)
When accept fails, with an error, this causes IsValid() to be == false, which causes SetBlocking to create a new socket with the following
// Make sure our socket is valid
if (!IsValid())
Create();
Simply remove the SetBlocking from that constructor and it allows Accept to properly fail and return NotReady