问题
I want to listen to connections from remote machines. However its not working. Using my browser i just simply connect to 127.0.0.1 and i know if i connected or not (both from the browser message and debugger).
127.0.0.1 works as does 127.0.0.2. But 192.x.x.x does not unless i use IPAddress.Parse("192.168.1.1") (assuming thats my local address). But any is suppose to work for any interface. Whats wrong with this? DoBeginAcceptTcpClient looks like this. The problem still exist for ports >1024. I tested with 1234
var server = new TcpListener(IPAddress.Any, 80);
server.Start(backlog);
while (true)
{
DoBeginAcceptTcpClient(server);
}
来源:https://stackoverflow.com/questions/11924661/why-cant-i-listen-to-remote-connections