Example #1
0
 public Task <bool> ConnectAsync(IPEndPoint endpoint)
 {
     EndPoint = (endpoint as HotelEndPoint);
     if (EndPoint == null)
     {
         EndPoint = new HotelEndPoint(endpoint);
     }
     return(ConnectAsync());
 }
Example #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;
        }
Example #3
0
        public HNode(Socket client)
        {
            _sendSlim    = new SemaphoreSlim(1, 1);
            _receiveSlim = new SemaphoreSlim(1, 1);

            if (client == null)
            {
                throw new ArgumentNullException(nameof(client));
            }

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

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