Esempio n. 1
0
 public Task <bool> ConnectAsync(IPEndPoint endpoint)
 {
     EndPoint = (endpoint as HotelEndPoint);
     if (EndPoint == null)
     {
         EndPoint = new HotelEndPoint(endpoint);
     }
     return(ConnectAsync());
 }
Esempio n. 2
0
        public HNode(Socket client)
        {
            if (client == null)
            {
                throw new ArgumentNullException(nameof(client));
            }

            if (client.RemoteEndPoint != null)
            {
                EndPoint = new HotelEndPoint((IPEndPoint)client.RemoteEndPoint);
            }

            Client         = client;
            Client.NoDelay = true;
        }
Esempio n. 3
0
 public Task <bool> ConnectAsync(string host, int port)
 {
     return(ConnectAsync(HotelEndPoint.Parse(host, port)));
 }
Esempio n. 4
0
 public static Task <HNode> ConnectNewAsync(string host, int port)
 {
     return(ConnectNewAsync(HotelEndPoint.Parse(host, port)));
 }