示例#1
0
文件: HNode.cs 项目: scottstamp/Geode
 public Task <bool> ConnectAsync(IPEndPoint endpoint)
 {
     EndPoint = (endpoint as HotelEndPoint);
     if (EndPoint == null)
     {
         EndPoint = new HotelEndPoint(endpoint);
     }
     return(ConnectAsync());
 }
示例#2
0
文件: HNode.cs 项目: scottstamp/Geode
        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;
        }
示例#3
0
文件: HNode.cs 项目: scottstamp/Geode
 public Task <bool> ConnectAsync(string host, int port)
 {
     return(ConnectAsync(HotelEndPoint.Parse(host, port)));
 }
示例#4
0
文件: HNode.cs 项目: scottstamp/Geode
 public static Task <HNode> ConnectNewAsync(string host, int port)
 {
     return(ConnectNewAsync(HotelEndPoint.Parse(host, port)));
 }