public static function isConnected($conn)
    {
        return (is_null($conn) !== true &&
                is_resource($conn) === true &&
                strtolower(get_resource_type($conn)) == 'socket');
    }
public static function isConnected($conn)
    {
        return (is_null($conn) !== true &&
                is_resource($conn) === true &&
                strtolower(get_resource_type($conn)) == 'socket');
    }
public static function isConnected ( $ conn ) { return ( is_null ( $ conn ) !== true && is_resource ( $ conn ) === true && strtolower ( get_resource_type ( $ conn ) ) == 'socket' ) ; }
Are we connected?

@param resource $conn The connection/socket to check

@return bool False if we aren't connected
Are we connected?