| @@ 278-292 (lines=15) @@ | ||
| 275 | /** |
|
| 276 | * @return string |
|
| 277 | */ |
|
| 278 | public function getSshUsername() |
|
| 279 | { |
|
| 280 | // what are we doing? |
|
| 281 | $log = Log::usingLog()->startAction("get username to use with SSH to host '{$this->args[0]}'"); |
|
| 282 | ||
| 283 | // make sure we have valid host details |
|
| 284 | $hostDetails = $this->getHostDetails(); |
|
| 285 | ||
| 286 | // get the information |
|
| 287 | $return = $hostDetails->sshUsername; |
|
| 288 | ||
| 289 | // all done |
|
| 290 | $log->endAction("username is '{$return}'"); |
|
| 291 | return $return; |
|
| 292 | } |
|
| 293 | ||
| 294 | /** |
|
| 295 | * @return string |
|
| @@ 297-311 (lines=15) @@ | ||
| 294 | /** |
|
| 295 | * @return string |
|
| 296 | */ |
|
| 297 | public function getSshKeyFile() |
|
| 298 | { |
|
| 299 | // what are we doing? |
|
| 300 | $log = Log::usingLog()->startAction("get key file to use with SSH to host '{$this->args[0]}'"); |
|
| 301 | ||
| 302 | // make sure we have valid host details |
|
| 303 | $hostDetails = $this->getHostDetails(); |
|
| 304 | ||
| 305 | // get the information |
|
| 306 | $return = $hostDetails->sshKeyFile; |
|
| 307 | ||
| 308 | // all done |
|
| 309 | $log->endAction("key file is '{$return}'"); |
|
| 310 | return $return; |
|
| 311 | } |
|
| 312 | ||
| 313 | /** |
|
| 314 | * @param string $sessionName |
|
| @@ 90-106 (lines=17) @@ | ||
| 87 | return $return; |
|
| 88 | } |
|
| 89 | ||
| 90 | public function recvNonBlocking() |
|
| 91 | { |
|
| 92 | // what are we doing? |
|
| 93 | $log = Log::usingLog()->startAction("recv() from ZMQ socket"); |
|
| 94 | ||
| 95 | // do it |
|
| 96 | $return = $this->args[0]->recv(ZMQ::MODE_NOBLOCK); |
|
| 97 | ||
| 98 | // all done |
|
| 99 | if ($return === false) { |
|
| 100 | $log->endAction("receive attempt would have blocked"); |
|
| 101 | } |
|
| 102 | else { |
|
| 103 | $log->endAction(); |
|
| 104 | } |
|
| 105 | return $return; |
|
| 106 | } |
|
| 107 | ||
| 108 | public function recvMulti($timeout = null) |
|
| 109 | { |
|
| @@ 137-153 (lines=17) @@ | ||
| 134 | return $return; |
|
| 135 | } |
|
| 136 | ||
| 137 | public function recvMultiNonBlocking() |
|
| 138 | { |
|
| 139 | // what are we doing? |
|
| 140 | $log = Log::usingLog()->startAction("recvmulti() from ZMQ socket"); |
|
| 141 | ||
| 142 | // do it |
|
| 143 | $return = $this->args[0]->recvmulti(ZMQ::MODE_NOBLOCK); |
|
| 144 | ||
| 145 | // all done |
|
| 146 | if ($return === false) { |
|
| 147 | $log->endAction("receive attempt would have blocked"); |
|
| 148 | } |
|
| 149 | else { |
|
| 150 | $log->endAction(); |
|
| 151 | } |
|
| 152 | return $return; |
|
| 153 | } |
|
| 154 | ||
| 155 | public function getEndpoints() |
|
| 156 | { |
|
| @@ 252-268 (lines=17) @@ | ||
| 249 | $log->endAction(); |
|
| 250 | } |
|
| 251 | ||
| 252 | public function sendMultiNonBlocking($message) |
|
| 253 | { |
|
| 254 | // what are we doing? |
|
| 255 | $log = Log::usingLog()->startAction("sendMultiNonBlocking() to ZMQ socket"); |
|
| 256 | ||
| 257 | // do it |
|
| 258 | $sent = $this->args[0]->sendmulti($message, ZMQ::MODE_NOBLOCK); |
|
| 259 | ||
| 260 | // all done |
|
| 261 | if ($sent) { |
|
| 262 | $log->endAction("message sent"); |
|
| 263 | } |
|
| 264 | else { |
|
| 265 | $log->endAction("message not sent"); |
|
| 266 | } |
|
| 267 | return $sent; |
|
| 268 | } |
|
| 269 | } |
|
| 270 | ||