90 if(strlen($packet = $this->server->readThreadToMainPacket()) > 0){
91 $id = ord($packet{0});
94 $len = ord($packet{$offset++});
95 $identifier = substr($packet, $offset, $len);
97 $flags = ord($packet{$offset++});
98 $buffer = substr($packet, $offset);
101 $len = ord($packet{$offset++});
102 $address = substr($packet, $offset, $len);
106 $payload = substr($packet, $offset);
107 $this->instance->handleRaw($address, $port, $payload);
109 $len = ord($packet{$offset++});
110 $name = substr($packet, $offset, $len);
112 $value = substr($packet, $offset);
113 $this->instance->handleOption($name, $value);
115 $len = ord($packet{$offset++});
116 $identifier = substr($packet, $offset, $len);
118 $len = ord($packet{$offset++});
119 $address = substr($packet, $offset, $len);
124 $this->instance->openSession($identifier, $address, $port, $clientID);
126 $len = ord($packet{$offset++});
127 $identifier = substr($packet, $offset, $len);
129 $len = ord($packet{$offset++});
130 $reason = substr($packet, $offset, $len);
131 $this->instance->closeSession($identifier, $reason);
133 $len = ord($packet{$offset++});
134 $identifier = substr($packet, $offset, $len);
135 $this->instance->closeSession($identifier,
"Invalid session");
137 $len = ord($packet{$offset++});
138 $identifier = substr($packet, $offset, $len);
141 $this->instance->notifyACK($identifier, $identifierACK);