public function changeMode($param)
{
switch ($param["type"]) {
case 1:
if ($param["group"] == "") {
throw new \Exception("change mode parameter is wrong", -1);
}
$this->connectMode = 1;
$this->connectGroup = $param["group"];
$this->connectIp = "";
$this->connectPort = "";
$this->currentClientKey = "";
break;
case 2:
if ($param["ip"] == "" || $param["port"] == "") {
throw new \Exception("change mode parameter is wrong", -1);
}
$this->connectMode = 2;
$this->connectGroup = "default";
$this->connectIp = $param["ip"];
$this->connectPort = $param["port"];
$this->currentClientKey = "";
break;
default:
throw new \Exception("change mode parameter is wrong", -1);
break;
}
}