php: Handle disconnect during receive call
ruby: Remove comma after constant that accidently created a tuple
ruby: Use correct unit for timeout value
php: Check socket before trying to set TCP_NODELAY

Also ignore socket_set_option errors.