Esempio n. 1
0
        /// <summary>
        /// Refuses the connection
        /// </summary>
        public async Task Refuse()
        {
            if ((Requestor && !Loopback) || Open)
            {
                return;
            }
            TcpCSSocketControl control = new TcpCSSocketControl(SocketId, TcpCSSocketControl.RefuseConnection);

            EP.TCPConnection.Stream.Write(control.Build());
            await Close(false);
        }
Esempio n. 2
0
 /// <summary>
 /// Accepts the connection
 /// </summary>
 public async Task Accept()
 {
     await Task.Run(() =>
     {
         if ((Requestor && !Loopback) || Open)
         {
             return;
         }
         Stream = new NRStream(this);
         TcpCSSocketControl control = new TcpCSSocketControl(SocketId, TcpCSSocketControl.AcceptConnection);
         EP.TCPConnection.Stream.Write(control.Build());
         Open = true;
     });
 }