pfsockopen

(PHP 4, PHP 5, PHP 7, PHP 8)

pfsockopenOpen persistent Internet or Unix domain socket connection

Descrição

pfsockopen(
    string$hostname,
    int$port = -1,
    int&$error_code = null,
    string&$error_message = null,
    ?float$timeout = null
): resource|false

This function behaves exactly as fsockopen() with the difference that the connection is not closed after the script finishes. It is the persistent version of fsockopen().

Parâmetros

For parameter information, see the fsockopen() documentation.

Valor Retornado

pfsockopen() returns a file pointer which may be used together with the other file functions (such as fgets(), fgetss(), fwrite(), fclose(), and feof()), ou false em caso de falha.

Registro de Alterações

VersãoDescrição
8.0.0timeout is nullable now.

Veja Também

  • fsockopen() - Abre uma conexão socket de domínio Unix ou Internet
To Top