public function setTimeout($timeout) { $s = Std::int($timeout); $ms = Std::int(($timeout - $s) * 1000000); $r = stream_set_timeout($this->__s, $s, $ms); sys_net_Socket::checkError($r, 0, "Unable to set timeout"); }
public function connect($host, $port) { $errs = null; $errn = null; $r = stream_socket_client($this->protocol . "://" . $host->hostName . ":" . _hx_string_rec($port, ""), $errn, $errs); sys_net_Socket::checkError($r, $errn, $errs); $this->__s = $r; $this->assignHandler(); }