You are here

public function SocketHandler::isConnected in Lagoon Logs 8

Check to see if the socket is currently available.

UDP might appear to be connected but might fail when writing. See http://php.net/fsockopen for details.

Return value

bool

2 calls to SocketHandler::isConnected()
SocketHandler::connectIfNotConnected in src/Logger/SocketHandler.php
SocketHandler::writeToSocket in src/Logger/SocketHandler.php

File

src/Logger/SocketHandler.php, line 219

Class

SocketHandler
Stores to any socket - uses fsockopen() or pfsockopen().

Namespace

Drupal\lagoon_logs\Logger

Code

public function isConnected() {
  return is_resource($this->resource) && !feof($this->resource);

  // on TCP - other party can close connection.
}