示例#1
0
        public static async Task <HNode> ConnectNewAsync(IPEndPoint endpoint)
        {
            HNode remote = null;

            try
            {
                remote = new HNode();
                await remote.ConnectAsync(endpoint).ConfigureAwait(false);
            }
            catch { remote = null; }
            finally
            {
                if (!remote?.IsConnected ?? false)
                {
                    remote = null;
                }
            }
            return(remote);
        }
示例#2
0
文件: HNode.cs 项目: xnumad/Sulakore
 public bool ReflectFormats(HNode other)
 {
     SendFormat    = other.ReceiveFormat;
     ReceiveFormat = other.SendFormat;
     return(IsWebSocket = other.IsWebSocket);
 }