Changeset View
Changeset View
Standalone View
Standalone View
src/hgdaemon/ArcanistHgProxyClient.php
| Show First 20 Lines • Show All 157 Lines • ▼ Show 20 Lines | private function connectToDaemon() { | ||||
| $errno = null; | $errno = null; | ||||
| $errstr = null; | $errstr = null; | ||||
| $socket_path = ArcanistHgProxyServer::getPathToSocket($this->workingCopy); | $socket_path = ArcanistHgProxyServer::getPathToSocket($this->workingCopy); | ||||
| $socket = @stream_socket_client('unix://'.$socket_path, $errno, $errstr); | $socket = @stream_socket_client('unix://'.$socket_path, $errno, $errstr); | ||||
| if ($errno || !$socket) { | if ($errno || !$socket) { | ||||
| throw new Exception( | throw new Exception( | ||||
| "Unable to connect socket! Error #{$errno}: {$errstr}"); | pht( | ||||
| 'Unable to connect socket! Error #%d: %s', | |||||
| $errno, | |||||
| $errstr)); | |||||
| } | } | ||||
| $channel = new PhutilSocketChannel($socket); | $channel = new PhutilSocketChannel($socket); | ||||
| $server = new ArcanistHgServerChannel($channel); | $server = new ArcanistHgServerChannel($channel); | ||||
| if (!$this->skipHello) { | if (!$this->skipHello) { | ||||
| // The protocol includes a "hello" message with capability and encoding | // The protocol includes a "hello" message with capability and encoding | ||||
| // information. Read and discard it, we use only the "runcommand" | // information. Read and discard it, we use only the "runcommand" | ||||
| Show All 23 Lines | |||||