update page now

socket_import_stream

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

socket_import_streamImporta un flujo

Descripción

socket_import_stream(resource $stream): Socket|false

Importa un flujo que encapsula un socket en un recurso.

Parámetros

stream

El recurso de flujo a importar.

Valores devueltos

Devuelve false en caso de error.

Historial de cambios

Versión Descripción
8.0.0 En caso de éxito, esta función devuelve ahora una instancia de Socket; anteriormente se devolvía un resource.

Ejemplos

Ejemplo #1 Ejemplo con socket_import_stream()

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

Ver también

add a note

User Contributed Notes 1 note

up
4
lcharron at meditech dot com
10 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
To Top

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant