protected function getAddress(&$addr, &$port, &$version = null)
{
$version = $this->getByte();
if ($version === 4) {
$addr = (~$this->getByte() & 0xff) . "." . (~$this->getByte() & 0xff) . "." . (~$this->getByte() & 0xff) . "." . (~$this->getByte() & 0xff);
$port = $this->getShort(false);
} else {
//TODO: IPv6
}
}