Click here to Skip to main content
15,892,809 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to create TCP connections between two clients in different LAN? Pin
Chuck O'Toole15-Feb-12 1:02
Chuck O'Toole15-Feb-12 1:02 
GeneralRe: How to create TCP connections between two clients in different LAN? Pin
Jochen Arndt15-Feb-12 1:07
professionalJochen Arndt15-Feb-12 1:07 
GeneralRe: How to create TCP connections between two clients in different LAN? Pin
Erudite_Eric15-Feb-12 1:26
Erudite_Eric15-Feb-12 1:26 
AnswerRe: How to create TCP connections between two clients in different LAN? Pin
Chuck O'Toole15-Feb-12 1:38
Chuck O'Toole15-Feb-12 1:38 
GeneralRe: How to create TCP connections between two clients in different LAN? Pin
Erudite_Eric15-Feb-12 2:55
Erudite_Eric15-Feb-12 2:55 
GeneralRe: How to create TCP connections between two clients in different LAN? Pin
Albert Holguin15-Feb-12 9:43
professionalAlbert Holguin15-Feb-12 9:43 
GeneralRe: How to create TCP connections between two clients in different LAN? Pin
yu-jian15-Feb-12 2:58
yu-jian15-Feb-12 2:58 
GeneralRe: How to create TCP connections between two clients in different LAN? Pin
Jochen Arndt15-Feb-12 3:33
professionalJochen Arndt15-Feb-12 3:33 
I understand the problem. Your systems are not only behind firewalls, but also behind routers that do NAT (network address translation) [^]. So the systems can't be seen from the "outside".

One solution would be to design your software as usual and change the network setup on the side that has a listening 'server'. This requires that the client side knows the WAN IP of the server side. If that IP is not static (dynamically assigned), you need to register at a dynamic DNS service like DynDNS and update the IP when getting a new dynamic one (routers usually have an option to do this). So the client can determine the server-side IP using normal DNS queries. Even with a static IP, you must configure a port forwarding on the router at the server side. This will forward packets from the WAN to a specific port on the local server system and vice versa.

Pro: Your software can be written as usual (like any other network software).
Con: Router / firewall must be configured. That may be restricted by policies when used in companies.

Another option is writing a special service application hosted on a system that is accessible from all clients and performs some kind of data forwarding. You are right, Emule and other file sharing applications do so. The service application stores a list of all connected clients that can be queried. The clients can then pick up other systems from the list and communicate using the service application.

Pro: No router / firewall setup changing necessary.
Con: Requires definition of an own protocol and writing the service application.
AnswerRe: How to create TCP connections between two clients in different LAN? Pin
Erudite_Eric15-Feb-12 0:37
Erudite_Eric15-Feb-12 0:37 
GeneralRe: How to create TCP connections between two clients in different LAN? Pin
yu-jian15-Feb-12 3:02
yu-jian15-Feb-12 3:02 
GeneralRe: How to create TCP connections between two clients in different LAN? Pin
Erudite_Eric15-Feb-12 22:35
Erudite_Eric15-Feb-12 22:35 
AnswerRe: How to create TCP connections between two clients in different LAN? Pin
Richard MacCutchan15-Feb-12 4:00
mveRichard MacCutchan15-Feb-12 4:00 
AnswerRe: How to create TCP connections between two clients in different LAN? Pin
Randor 15-Feb-12 13:26
professional Randor 15-Feb-12 13:26 
QuestionSHA1 encoding using Windows Crypto API with Unmanaged C++ Pin
Cyber Friend14-Feb-12 11:54
Cyber Friend14-Feb-12 11:54 
AnswerRe: SHA1 encoding using Windows Crypto API with Unmanaged C++ Pin
pix_programmer14-Feb-12 20:48
pix_programmer14-Feb-12 20:48 
GeneralRe: SHA1 encoding using Windows Crypto API with Unmanaged C++ Pin
Cyber Friend15-Feb-12 12:16
Cyber Friend15-Feb-12 12:16 
AnswerRe: SHA1 encoding using Windows Crypto API with Unmanaged C++ Pin
Randor 15-Feb-12 13:37
professional Randor 15-Feb-12 13:37 
GeneralRe: SHA1 encoding using Windows Crypto API with Unmanaged C++ [Resolved] Pin
Cyber Friend15-Feb-12 13:41
Cyber Friend15-Feb-12 13:41 
Questionfopen increment Pin
manju 314-Feb-12 3:16
manju 314-Feb-12 3:16 
AnswerRe: fopen increment Pin
Maximilien14-Feb-12 4:16
Maximilien14-Feb-12 4:16 
AnswerRe: fopen increment Pin
«_Superman_»14-Feb-12 16:15
professional«_Superman_»14-Feb-12 16:15 
QuestionApplication Crash Pin
pix_programmer14-Feb-12 1:51
pix_programmer14-Feb-12 1:51 
AnswerRe: Application Crash Pin
Chris Losinger14-Feb-12 3:10
professionalChris Losinger14-Feb-12 3:10 
QuestionRe: Application Crash Pin
pix_programmer14-Feb-12 17:45
pix_programmer14-Feb-12 17:45 
QuestionPicture control Pin
sarfaraznawaz13-Feb-12 23:57
sarfaraznawaz13-Feb-12 23:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.