| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 43 | protected function canConnect($url, $port) { |
||
| 44 | $this->logger->debug("attempting to connect to <$url> on port <$port>"); |
||
| 45 | $fp = fsockopen($url, $port, $error, $errorstr, self::CONNECTION_TIMEOUT); |
||
| 46 | if (is_resource($fp)) { |
||
| 47 | fclose($fp); |
||
| 48 | $this->logger->debug("connection to <$url> on port <$port> established"); |
||
| 49 | return true; |
||
| 50 | } |
||
| 51 | $this->logger->debug("cannot connect to <$url> on port <$port>"); |
||
| 52 | return false; |
||
| 53 | } |
||
| 54 | |||
| 56 |