Checking for null sockets