views:

182

answers:

2

Hi All

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 is 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.

+3  A: 

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.

Vivek Bernard
The sample did work locally although I no longer have that sample but am trying to find it again. And yes I am using my true IP like this: "117.197.199.138" etc
baeltazor
and yes my friend is not using a dynamic ip. he has a static one, and so do i.
baeltazor
Is that static IP the actual IP on your friend's computer or is he behind a NAT router (his computer has an IP address like 192.168.*.*? If so you will need to setup port forwarding on the router.
shf301
+1  A: 

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.

Paul Sasik
As a separate thing: I am using Abyss Web Server for my website and people can connect to it from theirr computers to access my site. This is separate from the program but i think it proves to me that my isp is not blocking me from running a server... I've also let my friend be the server while i try to connect to him and that doesnt work either
baeltazor
What port do you have that web server running on? Sometimes they selectively kill certain ports. Something you could do is set your port # for your app to that of Abyss, turn that off of course, and tr again.
Paul Sasik
i just tried that. unfortunately no luck. but thanks for the suggestion
baeltazor