| @@ 91-106 (lines=16) @@ | ||
| 88 | $log->endAction(); |
|
| 89 | } |
|
| 90 | ||
| 91 | public function unbindFromAllPorts() |
|
| 92 | { |
|
| 93 | // what are we doing? |
|
| 94 | $log = usingLog()->startAction("unbind() ZMQ socket from all ports"); |
|
| 95 | ||
| 96 | // where are we unbinding from? |
|
| 97 | $endpoints = fromZmqSocket($this->args[0])->getEndpoints(); |
|
| 98 | ||
| 99 | foreach($endpoints['bind'] as $address) { |
|
| 100 | usingLog()->writeToLog("unbinding from {$address}"); |
|
| 101 | $this->args[0]->unbind($address); |
|
| 102 | } |
|
| 103 | ||
| 104 | // all done |
|
| 105 | $log->endAction(); |
|
| 106 | } |
|
| 107 | ||
| 108 | public function connectToHost($hostId, $port, $sendHwm = 100, $recvHwm = 100) |
|
| 109 | { |
|
| @@ 151-166 (lines=16) @@ | ||
| 148 | $log->endAction(); |
|
| 149 | } |
|
| 150 | ||
| 151 | public function disconnectFromAllHosts() |
|
| 152 | { |
|
| 153 | // what are we doing? |
|
| 154 | $log = usingLog()->startAction("disconnect() ZMQ socket from all endpoints"); |
|
| 155 | ||
| 156 | // where are we disconnecting from? |
|
| 157 | $endpoints = fromZmqSocket($this->args[0])->getEndpoints(); |
|
| 158 | ||
| 159 | foreach($endpoints['connect'] as $address) { |
|
| 160 | usingLog()->writeToLog("disconnecting from {$address}"); |
|
| 161 | $this->args[0]->disconnect($address); |
|
| 162 | } |
|
| 163 | ||
| 164 | // all done |
|
| 165 | $log->endAction(); |
|
| 166 | } |
|
| 167 | ||
| 168 | public function close() |
|
| 169 | { |
|
| @@ 190-203 (lines=14) @@ | ||
| 187 | $log->endAction("session running as PID {$sessionDetails->pid}"); |
|
| 188 | } |
|
| 189 | ||
| 190 | public function stopInScreen($sessionName) |
|
| 191 | { |
|
| 192 | // what are we doing? |
|
| 193 | $log = usingLog()->startAction("stop screen session '{$sessionName}' on host '{$this->args[0]}'"); |
|
| 194 | ||
| 195 | // get the process details |
|
| 196 | $processDetails = fromHost($this->args[0])->getScreenSessionDetails($sessionName); |
|
| 197 | ||
| 198 | // stop the process |
|
| 199 | usingHost($this->args[0])->stopProcess($processDetails->pid); |
|
| 200 | ||
| 201 | // all done |
|
| 202 | $log->endAction(); |
|
| 203 | } |
|
| 204 | ||
| 205 | public function stopAllScreens() |
|
| 206 | { |
|