Why can't i listen to remote connections?

落爺英雄遲暮 提交于 2020-01-17 04:51:07

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!