Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8875243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:55:40+00:00 2026-06-14T18:55:40+00:00

I want to set-up a peer to peer connection between some computers, so users

  • 0

I want to set-up a peer to peer connection between some computers, so users can chat and exchange files without an external Server. My first thoughts were as follows:

I make a central ServerSocket on a server, where all applications can connect to. This ServerSocket keeps track of the connected sockets (clients), and gives the IP and Port of a new connected client to all other clients.
Each client creates a new ServerSocket to which all clients can connect to.

enter image description here

In other words: every client has a ServerSocket with all other clients connected to it. The messages should go via the blue lines in the images.

There is just one little problem I run on: if I test this via all different IP addresses, it works fine, but when two clients have the same (external) IP-adress, it doesn’t work any more. Does someone know a smart solution for this?

Thanks! Marc

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:55:42+00:00Added an answer on June 14, 2026 at 6:55 pm

    When a host is behind a NAT router and wants to open a server port which is supposed to be accessible from the other side of the NAT, the NAT router has to be configured to forward all incomming connections on this port to this host.

    Obviously, the NAT router can’t be configured to do this for two different hosts which listen to the same port. It can’t know which of the hosts is supposed to handle each incomming connection. When there are two servers behind a NAT, they have to use different ports, and the NAT router has to be configured to forward each port to each server.

    This is a known problem for peer-to-peer networks. Its result is that a direct connection between two clients which are both behind NATs is only possible when at least one of their NATs is configured for port forwarding and thus can act as a server to the other.

    Solutions:

    A workaround to connect two clients which are locked behind non-forwarding NATs would be to add the ability to use a 3rd client which is server-capable as a middle-man between them.

    When two clients are behind the same NAT, they could exchange their LAN IPs via the central server and use these to connect to each other.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want set mail function of Apache Server in php.ini so that it can
i want set some fields, like updateDate, createDate and deleteDate, for each my entities,
I want set default icon of some extension by C#. But this gives me
i have one textfield for input some serial number code.i want set this code
At first, sorry for my bad English I want set exclude files in jrebel
How I can set the culture of the ui automatically based on the users'browser?
I want set interfaceOrientation in one UIView as LandscapeLeft and Portrait in other UIView.
i want set the visibility to itemized overlay in map view. if the zoom
I want set Listbox background to transparent but not working Is there any idea?
i want set class for repeater when doPostBack for those dataID i wan but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.