| @@ 98-105 (lines=8) @@ | ||
| 95 | } |
|
| 96 | } |
|
| 97 | ||
| 98 | if ($this->state === self::STATE_DATA) { |
|
| 99 | if (false === ($this->result = $this->readExact($this->valueLength))) { |
|
| 100 | return; //we do not have a whole packet |
|
| 101 | } |
|
| 102 | $this->state = self::STATE_ROOT; |
|
| 103 | $this->setWatermark(1); |
|
| 104 | goto start; |
|
| 105 | } |
|
| 106 | } |
|
| 107 | } |
|
| 108 | ||
| @@ 226-233 (lines=8) @@ | ||
| 223 | $this->onUdpPacket($this->read($this->getInputLength())); |
|
| 224 | return; |
|
| 225 | } |
|
| 226 | if ($this->state === self::STATE_ROOT) { |
|
| 227 | if (false === ($hdr = $this->readExact(2))) { |
|
| 228 | return; // not enough data |
|
| 229 | } |
|
| 230 | $this->pctSize = Binary::bytes2int($hdr); |
|
| 231 | $this->setWatermark($this->pctSize); |
|
| 232 | $this->state = self::STATE_PACKET; |
|
| 233 | } |
|
| 234 | if ($this->state === self::STATE_PACKET) { |
|
| 235 | if (false === ($pct = $this->readExact($this->pctSize))) { |
|
| 236 | return; // not enough data |
|
| @@ 234-241 (lines=8) @@ | ||
| 231 | $this->setWatermark($this->pctSize); |
|
| 232 | $this->state = self::STATE_PACKET; |
|
| 233 | } |
|
| 234 | if ($this->state === self::STATE_PACKET) { |
|
| 235 | if (false === ($pct = $this->readExact($this->pctSize))) { |
|
| 236 | return; // not enough data |
|
| 237 | } |
|
| 238 | $this->state = self::STATE_ROOT; |
|
| 239 | $this->setWatermark(2); |
|
| 240 | $this->onUdpPacket($pct); |
|
| 241 | } |
|
| 242 | goto start; |
|
| 243 | } |
|
| 244 | ||