Esempio n. 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);
        }
Esempio n. 2
0
 public bool ReflectFormats(HNode other)
 {
     SendFormat    = other.ReceiveFormat;
     ReceiveFormat = other.SendFormat;
     return(IsWebSocket = other.IsWebSocket);
 }