Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Latest commit

 

History

History
25 lines (20 loc) · 370 Bytes

README.md

File metadata and controls

25 lines (20 loc) · 370 Bytes

php-async

Asynchronous components for PHP

TCP Server

server.php

$server = new \Async\TCPServer("tcp://0.0.0.0:4000");
$server->onConnect(function(){
    echo "A client connected\n";
});
$server->onData(function($data){
    echo "Client said: $data\n";
});

$server->run();

Then you can do this:

# telnet localhost 4000