public function checkDomain($domain) { // make or get the socket filehandle if (!$this->init_socket()) { throw new APIException('oSRS Error - Unable to establish socket: (' . $this->_socketErrorNum . ') ' . $this->_socketErrorMsg); } // Send a check call $callCheck = 'check_domain ' . $domain; $callLength = strlen($callCheck); fputs($this->_socket, $callCheck, $callLength); // // wait 0.25 sec - Immediate socket read will result for wait loops and longer response // usleep(250000); // Read result hand for parsing $result = fread($this->_socket, 1024); $data = $this->parseResult($result); // Close the socket $this->close_socket(); return $data; }