public function flush()
{
if (!$this->data) {
return;
}
try {
$fp = fsockopen($this->protocol . '://' . $this->host, $this->port);
if (!$fp) {
return;
}
foreach ($this->data as $line) {
fwrite($fp, $line);
}
fclose($fp);
} catch (Exception $e) {
}
$this->data = array();
}