public bool ConnectProxy(string ip, int port) { if (clientCore.connection != null && clientCore.Connection.socket.Connected) { clientCore.connection.Disconnect(false); } clientCore.proxyIp = ip; clientCore.proxyPort = port; IPAddress host = IpU.GetIPV4Address(ip); if (host == null) { return(false); } clientCore.connection = new Connection(new IPEndPoint(host, port)); clientCore.connection.OnConnected = OnMyConnected; clientCore.connection.OnDisconnected = OnMyDisconnected; clientCore.connection.OnReceived = OnMyReceived; clientCore.connection.Connect(); return(true); }
public bool create(string ip, int port, string account, string pass, nicehu.pb.DeviceInfo deviceInfo) { IPAddress ipAddress = IpU.GetIPV4Address(ip); if (ipAddress == null) { return(false); } createHandler.Create(new IPEndPoint(ipAddress, port), account, pass, deviceInfo); return(true); }
public bool login(string ip, int port, String account, String pass, nicehu.pb.DeviceInfo deviceInfo) { string guid = Guid.NewGuid().ToString(); IPAddress host = IpU.GetIPV4Address(ip); if (host == null) { return(false); } loginHandler.Login(new IPEndPoint(host, port), account, pass, guid, deviceInfo); return(true); }