Thruway\Transport\RawSocketClientTransportProvider::startTransportProvider PHP Метод

startTransportProvider() публичный Метод

Start transport provider
public startTransportProvider ( Thruway\Peer\ClientInterface $client, React\EventLoop\LoopInterface $loop )
$client Thruway\Peer\ClientInterface
$loop React\EventLoop\LoopInterface
    public function startTransportProvider(ClientInterface $client, LoopInterface $loop)
    {
        $this->client = $client;
        $this->loop = $loop;
        $dnsResolverFactory = new \React\Dns\Resolver\Factory();
        $dns = $dnsResolverFactory->createCached('8.8.8.8', $loop);
        $connector = new Connector($loop, $dns);
        $connector->create($this->address, $this->port)->then(function (Stream $stream) {
            $stream->on('data', [$this, "handleData"]);
            $stream->on('close', [$this, "handleClose"]);
            $this->handleConnection($stream);
        });
    }