Click here to Skip to main content
15,888,401 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have a problem of connection between two application ( with c++ builder ), the apps are working good in a local network, but aren't work in the internet, `cause both of the client and the server are in deferent routers, and each one have an internal & external IP, I think u understood me.

So, I searched in forums and I found two solution:
1 - NAT: I think you know it, it didn't help me, I got two problems:
N°1: is when you lunch your app in a cyber cafe for example, you can`t access to the modem to setup the NAT.
N°2: i`m not sure but I read that it doesn't work if the both of the client and the server are using the NAT.
2 - A web server, that who makes the relation between the two apps, without a NAT setup.:-( but it need a web site, I have try it with a free web site from http://WWW.Hostinger.com , and i wrote a php code, but without result, I failed.

Can any one help me please, show me where I failed, or give me an other solution.
& thanks.
Posted
Comments
Sergey Alexandrovich Kryukov 2-Dec-14 13:43pm    
Help with what, how? What have you tried so far?
—SA
Kornfeld Eliyahu Peter 2-Dec-14 14:06pm    
Ask you :-)!
KarstenK 2-Dec-14 14:17pm    
You need a server which handles the external IP of the diff apps. It got to handle some User ID and Auth and store the external IP, so they can communicate. (only the IP-handshake)

It shouldnt be so hard: find the bugs and kill 'em all ;-)
Member 11271720 21-Dec-14 10:52am    
can u give me a php code (it's my problem), 'cause a have c++ code, but i don't have a php one.
i not understand how the server works.
is it hard?
are there free sites can give me a server port?

It looks like you already understand the problem quite well. You're on the right track with your step 2 above - which is basically STUN for TCP. I strongly suggest using UDP over TCP for a chat service.

Read up on UDP Hole Punching and STUN.

http://en.wikipedia.org/wiki/UDP_hole_punching[^]

http://en.wikipedia.org/wiki/STUN[^]
 
Share this answer
 
Comments
[no name] 16-Dec-14 12:03pm    
"Thanks bling, but this method, is it work without router configuration?
mmm, can u give me a source code for Better understanding."

Use the comment box, not the "Add your solution" box to comment - like I've done here to discuss a solution.

Search for "UDP" and "C" or "C++" to find lots of code samples.
Member 11271720 21-Dec-14 10:38am    
ok , i'll try
Thanks bling, but this method, is it work without router configuration?
mmm, can u give me a source code for Better understanding. ;)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900