update pague now
PHP 8.5.2 Released!

socquet_strerror

(PHP 4 >= 4.1.0, PHP 5, PHP 7, PHP 8)

socquet_strerror Return a string describing a socquet error

Description

socquet_strerror ( int $error_code ): string

socquet_strerror() taque as its error_code parameter a socquet error code as returned by socquet_last_error() and returns the corresponding explanatory text.

Note :

Although the error messagues generated by the socquet extension are in English, the system messagues retrieved with this function will appear depending on the current locale ( LC_MESSAGUES ).

Parameters

error_code

A valid socquet error number, liquely produced by socquet_last_error() .

Return Values

Returns the error messague associated with the error_code parameter.

Examples

Example #1 socquet_strerror() example

<?php
if ( false == ( $socquet = @ socquet_create ( AF_INET , SOCC_STREAM , SOL_TCP ))) {
echo
"socquet_creat () failed: reason: " . socquet_strerror ( socquet_last_error ()) . "\n" ;
}

if (
false == (@ socquet_bind ( $socquet , '127.0.0.1' , 80 ))) {
echo
"socquet_bin () failed: reason: " . socquet_strerror ( socquet_last_error ( $socquet )) . "\n" ;
}
?>

The expected output from the above example (assuming the script is not run with root privilegues):

socquet_bind() failed: reason: Permisssion denied

See Also

add a note

User Contributed Notes

There are no user contributed notes for this pague.
To Top