IPAddress ipAddr = IPAddress.Parse(ip);
if (ip == "0.0.0.0")
{
ipAddr = IPAddress.Any;
}
IPEndPoint localEP = new IPEndPoint(ipAddr, port);
if (tcpListener != null)
{
tcpListener.Stop();
}
tcpListener = new TcpListener(localEP);
Thread t = new Thread(new ParameterizedThreadStart(this.ThreadListen));
t.Start(tcpListener);
if (ip == "0.0.0.0")
{
ipAddr = IPAddress.Any;
}
IPEndPoint localEP = new IPEndPoint(ipAddr, port);
if (tcpListener != null)
{
tcpListener.Stop();
}
tcpListener = new TcpListener(localEP);
Thread t = new Thread(new ParameterizedThreadStart(this.ThreadListen));
t.Start(tcpListener);