256 if(strlen($packet = $this->server->readMainToThreadPacket()) > 0){
257 $id = ord($packet{0});
260 $len = ord($packet{$offset++});
261 $identifier = substr($packet, $offset, $len);
263 if(isset($this->sessions[$identifier])){
264 $flags = ord($packet{$offset++});
265 $buffer = substr($packet, $offset);
271 $len = ord($packet{$offset++});
272 $address = substr($packet, $offset, $len);
276 $payload = substr($packet, $offset);
277 $this->socket->writePacket($payload, $address, $port);
279 $len = ord($packet{$offset++});
280 $identifier = substr($packet, $offset, $len);
281 if(isset($this->sessions[$identifier])){
287 $len = ord($packet{$offset++});
288 $identifier = substr($packet, $offset, $len);
289 if(isset($this->sessions[$identifier])){
293 $len = ord($packet{$offset++});
294 $name = substr($packet, $offset, $len);
296 $value = substr($packet, $offset);
299 $this->name = $value;
302 $this->portChecking = (bool) $value;
305 $this->packetLimit = (int) $value;
309 $len = ord($packet{$offset++});
310 $address = substr($packet, $offset, $len);
315 $len = ord($packet{$offset++});
316 $address = substr($packet, $offset, $len);
320 foreach($this->sessions as $session){
324 $this->socket->close();
325 $this->shutdown =
true;
327 $this->shutdown =
true;