public static void Start(string[] args) { TcpList tcpList = null; UdpItem udpItem = null; try { //формируем список очередей var channelList = new ChannelList(); //запускаем прослушивание tcp tcpList = new TcpList(channelList); var tcpListThread = new Thread(new ThreadStart(tcpList.ListenList)); tcpListThread.Start(); //запускаем прослушивание udp udpItem = new UdpItem(channelList); var udpItemThread = new Thread(new ThreadStart(udpItem.Listen)); udpItemThread.Start(); } catch (Exception ex) { if (tcpList != null) { tcpList.DisconnectList(); } Console.WriteLine(ex.Message); } }
public TcpItem(TcpClient tcpClient, TcpList tcpList) { Uid = Guid.NewGuid(); client = tcpClient; this.tcpList = tcpList; }