public function handleConnect()
    {
        $socket = @stream_socket_accept($this->socket);

        if ($socket === false)
        {
            $this->emit('error', [ $this, new ReadException('Socket could not accept new connection.') ]);
            return;
        }

        $client = null;
        $ex = null;

        try
        {
            $client = $this->createClient($socket, [
                'ssl' => $this->config['ssl'],
                'ssl_method' => $this->config['ssl_method'],
            ]);

            $this->emit('connect', [ $this, $client ]);
        }
        catch (Error $ex)
        {}
        catch (Exception $ex)
        {}

        if ($ex !== null)
        {
            $this->handleDisconnect($socket);
            $this->emit('error', [ $this, new ReadException('Socket could not wrap new connection!') ]);
        }
    }
public function handleConnect()
    {
        $socket = @stream_socket_accept($this->socket);

        if ($socket === false)
        {
            $this->emit('error', [ $this, new ReadException('Socket could not accept new connection.') ]);
            return;
        }

        $client = null;
        $ex = null;

        try
        {
            $client = $this->createClient($socket, [
                'ssl' => $this->config['ssl'],
                'ssl_method' => $this->config['ssl_method'],
            ]);

            $this->emit('connect', [ $this, $client ]);
        }
        catch (Error $ex)
        {}
        catch (Exception $ex)
        {}

        if ($ex !== null)
        {
            $this->handleDisconnect($socket);
            $this->emit('error', [ $this, new ReadException('Socket could not wrap new connection!') ]);
        }
    }
public function handleConnect ( ) { $ socket = @ stream_socket_accept ( $ this -> socket ) ; if ( $ socket === false ) { $ this -> emit ( 'error' , [ $ this , new ReadException ( 'Socket could not accept new connection.' ) ] ) ; return ; } $ client = null ; $ ex = null ; try { $ client = $ this -> createClient ( $ socket , [ 'ssl' => $ this -> config [ 'ssl' ] , 'ssl_method' => $ this -> config [ 'ssl_method' ] , ] ) ; $ this -> emit ( 'connect' , [ $ this , $ client ] ) ; } catch ( Error $ ex ) { } catch ( Exception $ ex ) { } if ( $ ex !== null ) { $ this -> handleDisconnect ( $ socket ) ; $ this -> emit ( 'error' , [ $ this , new ReadException ( 'Socket could not wrap new connection!' ) ] ) ; } }
Handle the new connection.

@internal
Handle the new connection .