This is just a guess, but it is because you're setting the socket to be blocking after the call to accept? If it defaults to non-blocking, this would cause accept to return immediately, so the client connecting would fail as the server isn't currently accepting connections. Also to verify it's not a firewall issue, for connecting try using 127.0.0.1.