Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Connection with getPublicAdress()  (Read 3354 times)

0 Members and 1 Guest are viewing this topic.

C_Worm

  • Newbie
  • *
  • Posts: 18
    • View Profile
Connection with getPublicAdress()
« on: April 13, 2019, 11:15:57 am »
I have two computers at Home which has the same public IP-adress.
The computers have diffrenet local IP’s.

Is it possile to send/receive using the public adress or must one use the local adress?

using the local adress works because i’ve tested it but when i change to the public adress, the server/client communication doesn’t work.

The program i’ve coded is just at simple testing program using UdpSockets nothing fancy.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Connection with getPublicAdress()
« Reply #1 on: April 13, 2019, 02:30:54 pm »
You may want to spend some time reading up on general networking topics (TCP/IP/UDP/NAT/etc).

When client and server are both on the same LAN it doesn't make sense to use public IPs.
You can't address the two different PCs with the same IP and same port. If you have different ports, you can configure your router's NAT to port-forward to either LAN IP.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

C_Worm

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Connection with getPublicAdress()
« Reply #2 on: April 13, 2019, 11:19:35 pm »
Allright, thanks! :)

 

anything