Exemplo n.º 1
0
 public Receiver(ConnectionUDP conn)
 {
     Conn     = conn;
     Uis      = new UDPInputStream(conn);
     MySender = conn.MySender;
     DstHost  = conn.DstHost;
     DstPort  = conn.DstPort;
 }
Exemplo n.º 2
0
        public ConnectionUDP(Route route, string dstHost, int dstPort,
                             int mode, int connectId, ClientControl clientControl)
        {
            MyClientControl = clientControl;
            MyRoute         = route;
            DstHost         = dstHost;
            DstPort         = dstPort;
            Mode            = mode;
            ConnectId       = connectId;

            try
            {
                MySender   = new Sender(this);
                MyRecevier = new Receiver(this);
                Uos        = new UDPOutputStream(this);
                Uis        = new UDPInputStream(this);

                /*
                 * if (mode == 2)
                 * {
                 *  route.CreateTunnelProcessor().Process(this);
                 * }
                 */
            }
            catch (Exception e)
            {
                _connected = false;
                route.ConnTable.Remove(connectId);

                lock (this)
                {
                    Monitor.PulseAll(this);
                }
                throw (e);
            }
        }