protected function connect($host, $port)
{
$this->socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
if (!$this->socket || !@socket_connect($this->socket, $host, $port)) {
$error = $this->getLastError();
throw new CommunicationException($error['message'], $error['code']);
}
}