protected function onRead()
{
while (($line = $this->readline()) !== null) {
$e = explode(' , ', $line);
if (sizeof($e) !== 2 || !ctype_digit($e[0]) || !ctype_digit($e[1])) {
$this->writeln($line . ' : ERROR : INVALID-PORT');
$this->finish();
return;
}
$local = (int) $e[0];
$foreign = (int) $e[1];
if ($user = $this->pool->findPair($local, $foreign)) {
$this->writeln($line . ' : USERID : ' . $user);
} else {
$this->writeln($line . ' : ERROR : NO-USER');
}
}
}