phpday 2027 - Call for Papers

socket_import_stream

(PHP 5 >= 5.4.0, PHP 7, PHP 8)

socket_import_stream — Importa uno stream

Descrizione

function socket_import_stream(resource $stream): Socket|false

Importa uno stream che incapsula un socket in una risorsa dell'estensione socket.

Elenco dei parametri

stream

La risorsa dello stream da importare.

Valori restituiti

Restituisce false in caso di fallimento.

Log delle modifiche

Versione Descrizione
8.0.0 In caso di successo, questa funzione restituisce ora un'istanza di Socket; in precedenza veniva restituita una resource.

Esempi

Example #1 Esempio di socket_import_stream()

<?php
$stream = stream_socket_server("udp://0.0.0.0:58380", $errno, $errstr, STREAM_SERVER_BIND); 
$sock   = socket_import_stream($stream);
?>

Vedere anche:

User Contributed Notes 1 note

up
4
lcharron at meditech dot com
11 years ago
This function does not support SSL connections.

I have submitted a bug/enhacement request because of this: https://bugs.php.net/bug.php?id=70939
Adding new notes is disabled. Please see the links in the Found A Problem? section.
To Top