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 6164779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:03:05+00:00 2026-05-23T22:03:05+00:00

I’m trying to add networking over the internet to my game, using Peer to

  • 0

I’m trying to add networking over the internet to my game, using Peer to Peer.
I have already implemented a LAN only version, which uses .NET’s peer to peer classes to connect within the local network.

I realized I need to use UDP hole punching in order to establish a connection to other clients that are behind a firewall.

This is how I have started to implement it:
The server is a HTTP server using very simple PHP scripts to get the job done.

    • register name on server, sending the private ip address and port as a GET variable
    • when the server gets a registration request, it will save the public endpoint and the private endpoint
    • request to connect to another client.
    • the server will return the private and public endpoints of the client
    • every two seconds, the second client will check in with the server, and if there is another client attempting to connect with it, it will get its endpoints too
    • both clients start spamming each others public endpoints until they get a valid response

Now I have a bunch of questions

  1. Can the server be a HTTP server?
  2. When I make a request to an HTTP server, the client port changes each time a request is made. Is a private endpoint always matched to the same public endpoint?
  3. Does the request to the server have to have the same source endpoint as the UDP messages to the client?
  4. Is there a way to connect to an HTTP server in C# using a specified source endpoint?
  5. Are there any problems with my implementation?

Thanks!

  • 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-05-23T22:03:08+00:00Added an answer on May 23, 2026 at 10:03 pm

    UDP hole punching is a complex topic, and many attempts have been made to find a solution that works. The problem is that there are so many different NAT routers out there, and there is no standard way of implementing NAT, so all routers behave a bit different.

    Some attempts have been standardized, e.g. STUN, ICE. They still work only in most cases, not all, but they accumulate a lot of knowledge and address many concerns — more than your attempt will ever be able to, simply because you can’t test your solution with every NAT router under the sun. Skype, for example, spent years of perfecting its NAT traversal mechanism.

    I recommend you have a look at STUN or preferably ICE. Try to implement one of them or look for existing implementations.

    Another option might be to simply create a port forward at the router, e.g. using UPnP or NAT-PMP.

    That said, I wouldn’t be surprised if the .NET peer to peer classes came with a NAT traversal mechanism, but I’m not familiar with them.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have thousands of HTML files to process using Groovy/Java and I need to
I am trying to loop through a bunch of documents I have to put
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,

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.