Home > Software design >  How connect to created stream from another script?
How connect to created stream from another script?

Time:09-10

A websocket server is created in one script

$server_socket = stream_socket_server('tcp://0.0.0.0:9000', $errno, $message);

How to connect and send data to this stream from another local PHP script?

CodePudding user response:

$fp = stream_socket_client("tcp://x.x.x.x:9000", $errno, $errstr, 30);

https://www.php.net/manual/en/function.stream-socket-client.php

  • Related