While adding a not alive socket to a SocketSet using method add() there is following error: ERR core.exception.OutOfMemoryError@src/core/exception.d(679): Memory allocation failed In some scenarios it is quite hard to find the root cause (not alive socket). An exception like InvalidSocket instead would be quite nice. Tested on linux.
I can't reproduce this: /////////////////////////// test.d ////////////////////////// import std.socket; void main() { auto ss = new SocketSet; auto s = new TcpSocket; ss.add(s); // succeeds ss.add(TcpSocket.init); // segmentation fault as expected } ///////////////////////////////////////////////////////////// Please reopen if you can provide a reproducible test case.