Hashtable socketHolder = new Hashtable();
Hashtable threadHolder = new Hashtable();
public Form1()
{
// Required for Windows Form Designer support
//
InitializeComponent();
tcpLsn = new TcpListener(8002);
tcpLsn.Start();
// tcpLsn.LocalEndpoint may have a bug, it only show 0.0.0.0:8002
stpanel.Text = "Listen at: " + tcpLsn.LocalEndpoint.ToString();
Thread tcpThd = new Thread(new ThreadStart(WaitingForClient));
threadHolder.Add(connectId, tcpThd);
tcpThd.Start() ;
} |