Пример #1
0
 public TcpCommunicator(EnvelopeQueue incoming, EnvelopeQueue outgoing, int port)
 {
     myListener = new TcpListener(new IPEndPoint(IPAddress.Any, port));
     inQ        = incoming;
     outQ       = outgoing;
     //startThreads();
 }
Пример #2
0
 public TcpCommunicator(EnvelopeQueue incoming, EnvelopeQueue outgoing, IPEndPoint EP)
 {
     myListener = new TcpListener(EP);
     inQ        = incoming;
     outQ       = outgoing;
     //startThreads();
 }
        public UdpCommunicator(EnvelopeQueue incoming, EnvelopeQueue outgoing, IPEndPoint EP)
        {
            myClient = new UdpClient(EP)
            {
                Client = { ReceiveTimeout = 100000 }
            };                                                                     //Timeout is set to 100 s. NOTE: shorten timeout.
            inQ  = incoming;
            outQ = outgoing;

            ////Start threads here.
            //Thread sendingThread = new Thread(new ThreadStart(sendStuff));
            //Thread recievingThread = new Thread(new ThreadStart(recieveStuff));

            //sendingThread.IsBackground = false;
            //recievingThread.IsBackground = false;

            //sendingThread.Start();
            //recievingThread.Start();
        }
Пример #4
0
 public Dispatcher(EnvelopeQueue inQueue)
 {
     this.inQueue = inQueue;
     running      = false;
 }