protected function resource() { if ($this->socket) { return $this->socket; } $rs = $this->connect(); if (!$rs) { return false; } return $this->socket ?: false; }