src/server/Server.php
private function accept(SocketServer $server): Generator
    {
        yield from log()->log(
            Log::INFO,
            'NNTP server listening on %s:%d',
            $server->getAddress(),
            $server->getPort()
        );

        while ($server->isOpen()) {
            // Wait for a client to connect.
            $socket = yield from $server->accept();

            // Handle the client in a separate coroutine.
            $coroutine = new Coroutine($this->handleClient($socket));
            $coroutine->done();
        }
    }
private function accept(SocketServer $server): Generator
    {
        yield from log()->log(
            Log::INFO,
            'NNTP server listening on %s:%d',
            $server->getAddress(),
            $server->getPort()
        );

        while ($server->isOpen()) {
            // Wait for a client to connect.
            $socket = yield from $server->accept();

            // Handle the client in a separate coroutine.
            $coroutine = new Coroutine($this->handleClient($socket));
            $coroutine->done();
        }
    }
private function accept ( SocketServer $ server ) : Generator { yield from log ( ) -> log ( Log :: INFO , 'NNTP server listening on %s:%d' , $ server -> getAddress ( ) , $ server -> getPort ( ) ) ; while ( $ server -> isOpen ( ) ) { // Wait for a client to connect. $ socket = yield from $ server -> accept ( ) ; // Handle the client in a separate coroutine. $ coroutine = new Coroutine ( $ this -> handleClient ( $ socket ) ) ; $ coroutine -> done ( ) ; } }
Accepts incoming connections as they are made.
Accepts incoming connections as they are made .