socket connections behind routers

Posted on 2005-05-16
Last Modified: 2008-02-26

I created a tcp stream client/server winsock program in C++, they work fine if both machine are directly connected to the modem. However I am in a situation where the client, server or both can be behind routers,  and I am unable to establish client-server connections.

I don't want to change the router settings and I don't want  the communication to go through some intermediate server.

Are there any software solutions to establish socket connection directly when either party can be behind a router ?  (some sample source code would be appreciated :) )

Question by:daniel_2004
    LVL 55

    Accepted Solution

    modern router have firewall features
    if you want to communicate trough a specific socket port, you must ensure it is unlocked in router configuration.
    Or you can try to use a standard port like 80 or 21 but not so recommendable.
    LVL 8

    Expert Comment

    You might want to look into tunneling: [" Tunneling Explained"]

    LVL 22

    Expert Comment

    This is a very basic problem-- you can't have a server behind a firewall, as most firewalls block incoming connection attempts.   That's the whole point of a firewall.

    You have to have some common meeting point that is NOT behind a firewall.


    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
    Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
    The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
    The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now