public TcpCommunicator(EnvelopeQueue incoming, EnvelopeQueue outgoing, int port) { myListener = new TcpListener(new IPEndPoint(IPAddress.Any, port)); inQ = incoming; outQ = outgoing; //startThreads(); }
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(); }
public Dispatcher(EnvelopeQueue inQueue) { this.inQueue = inQueue; running = false; }