I'd like my app to be able to communicate with itself via the internet but this is proving to be impossible for me. One thing I've never been able to work out i开发者_运维百科s Tcp or the whole networking thing in general.
I have read the docs and seen literally over 30 samples, none of which have ever worked.
All I'm trying to do is send a message from my program on my computer to my program on my friends computer (on a different network).
But nothing ever works. I would post sample code but I think that would be pointless as all the different samples have given me different errors etc, here's the list of errors that we get:
1: Cannot connect to target because the remote machine actively refused it. 2: Connection timeout.
Can somebody please help me figure this out?
Thank you lots in advance
Edit: 1. Also, We have both tried completely disabling all firewalls. That did not help at all. 2. I have tried to loop through available ports, but this did not make any difference either.
There might be a couple of reasons
1) Does the sample work locally
2) are you using the True IP, the Ip provided by your ISP.
Because the Ips like 192.168.1.* or 172.16.. wont work on the internet (you can find that by googling "my ipaddress")
eg is 117.197.199.138
3)If you or your friend is using a dynamic Ip it may change from time to time, so that may also be a reason why it does'nt work.
One issue is that your ISP might be blocking all server requests. Some ISPs don't let you run server unless you pay for a biz-level rate.
精彩评论