public function __construct($dsn) { $socket = stream_socket_client($dsn, $errno, $errstr); if (!$socket) { throw new \Exception("Unable to bind to {$dsn} ({$errno}:{$errstr})"); } parent::__construct($socket); }
public function __construct(Server $server, $socket) { $this->server = $server; parent::__construct($socket); }