Beispiel #1
0
 public Sender(ConnectionUDP conn)
 {
     Conn       = conn;
     Uos        = new UDPOutputStream(conn);
     MyReceiver = conn.MyRecevier;
     DstHost    = conn.DstHost;
     DstPort    = conn.DstPort;
 }
Beispiel #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);
            }
        }