Ejemplo n.º 1
0
        public void SetNetworkData(object data)
        {
            HServerInformation server = (HServerInformation)data;

            this.server = server;
            if (server != null)
            {
                this.Guid = server.Guid;
                this.Name = server.Name;
                State     = ConnectionState.Connected;
            }
            else
            {
                State = ConnectionState.Disconnected;
            }
        }
Ejemplo n.º 2
0
        public async Task ConnectAsync(string ip)
        {
            await CancelScanningAsync();

            Guid guid = await client.ConnectAsync(new HostName(ip), SHUB_PORT);

            // Connection timeout
            if (guid == default(Guid))
            {
                if (ConnectionTimeout != null)
                {
                    ConnectionTimeout(this, ip);
                }
                return;
            }

            if (NewProfile != null)
            {
                HServerInformation serverInf = client.GetServer(guid);
                TClientProfile     profile   = new TClientProfile(serverInf, serverInf.IP);
                profile.State = ConnectionState.Connected;
                NewProfile(this, profile);
            }
        }
Ejemplo n.º 3
0
 public TClientProfile(HServerInformation server, string ip = "127.0.0.1")
 {
     LastIPAddress = ip;
     SetNetworkData(server);
 }