开发者

Port forwarding problem

开发者 https://www.devze.com 2023-03-27 23:41 出处:网络
I\'m currently developing java PC/Android application with server written in java. When I was developing PC client I was starting server on localhost:12345, and client could, without any problems, con

I'm currently developing java PC/Android application with server written in java. When I was developing PC client I was starting server on localhost:12345, and client could, without any problems, connect to this server (using the same host name and port). Problems started yesterday when I tried to connect using android device. I use my mobile phone to develop app and as a host address I input my router's public IP 89.xx.xx.xxx and the same port as in PC client (12345). Of course I set up port forwarding on my router (for ports 12344 to 12346 ), and I created rules for any connection type on port 12345 in windows defender. But still no success. This is weird because about 8 months before i was developing other app and everything just worked. Strange thing is that there was no windows prompt window when I started server and PC client for the first time (win defender 开发者_开发问答prompt to allow my app to connect to the internet). I think that's something's wrong with the router's forwarding (because on localhost it works properly), but I do not know what else I can do. I turned ON UPnP beside forwarding. My router is THOMSON TWG850-4U. After a couple seconds I get timed-out exception in my android app


Are you sure your server is binding 0.0.0.0 (accept incoming connections on any interface) rather than 127.0.0.1 (only localhost connections accepted)?


If you are already binding to 0.0.0.0 then try setting your router to DMZ your PCs IP address and see if you are allowed to connect.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号