/**
* @param string $id
* @param string $data
* @return bool
*/
private function writeData($id, $data)
{
if ($this->socket === null) {
return false;
}
try {
if ($this->type === Channel::CONNECTOR) {
return $this->socket->write($data);
}
if ($this->type === Channel::BINDER && $this->connectionPool->existsConnection($id)) {
return $this->connectionPool->getConnection($id)->getSocket()->write($data);
}
} catch (Error $ex) {
return false;
} catch (Exception $ex) {
return false;
}
return false;
}