protected static function getErrorMessage($code)
    {
        $string = socket_strerror($code);

        // search constant starting with SOCKET_ for this error code
        foreach (get_defined_constants() as $key => $value) {
            if($value === $code && strpos($key, 'SOCKET_') === 0) {
                $string .= ' (' . $key . ')';
                break;
            }
        }

        return $string;
    }
protected static function getErrorMessage($code)
    {
        $string = socket_strerror($code);

        // search constant starting with SOCKET_ for this error code
        foreach (get_defined_constants() as $key => $value) {
            if($value === $code && strpos($key, 'SOCKET_') === 0) {
                $string .= ' (' . $key . ')';
                break;
            }
        }

        return $string;
    }
protected static function getErrorMessage ( $ code ) { $ string = socket_strerror ( $ code ) ; // search constant starting with SOCKET_ for this error code foreach ( get_defined_constants ( ) as $ key => $ value ) { if ( $ value === $ code && strpos ( $ key , 'SOCKET_' ) === 0 ) { $ string .= ' (' . $ key . ')' ; break ; } } return $ string ; }
get error message for given error code

@param int $code error code
@return string
@uses socket_strerror() to translate error code to error message
@uses get_defined_constants() to check for related error constant
get error message for given error code