protected function onIncoming(SocketServer $socket, Closure $callback): void
    {
        $socket->on('connection', function ($conn) use ($callback) {
            $conn->on('data', $callback);
        });
    }
protected function onIncoming(SocketServer $socket, Closure $callback): void
    {
        $socket->on('connection', function ($conn) use ($callback) {
            $conn->on('data', $callback);
        });
    }
protected function onIncoming ( SocketServer $ socket , Closure $ callback ) : void { $ socket -> on ( 'connection' , function ( $ conn ) use ( $ callback ) { $ conn -> on ( 'data' , $ callback ) ; } ) ; }
Register a callback for incoming data.

@param  \React\Socket\Server  $socket
@param  \Closure  $callback

@return void
Register a callback for incoming data .