public function read() { AirD::Log(AirD::LOGTYPE_INTERNAL, "socketServer's read", true); $client = new $this->client_class(parent::accept()); $this->on_accept($client); return $client; }
public function read($length = 4096) { try { $this->read_buffer .= parent::read($length); $this->on_read(); } catch (socketException $e) { AirD::Log(AirD::LOGTYPE_INTERNAL, "Exception caught while reading from socket " . (int) $this->socket . ": " . $e->getMessage()); $old_socket = (int) $this->socket; $this->close(); $this->socket = $old_socket; $this->disconnected = true; $this->on_disconnect(); } }