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

Author Topic: Network - not LAN connection  (Read 2478 times)

0 Members and 1 Guest are viewing this topic.

WithoutBrain

  • Newbie
  • *
  • Posts: 20
    • View Profile
    • Email
Network - not LAN connection
« on: November 28, 2016, 06:51:22 pm »
How can I connect to another pc without LAN. Thank you very much.   (I am sorry for my english)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Network - not LAN connection
« Reply #1 on: November 28, 2016, 09:00:23 pm »
And without LAN you mean over the internet? You just need to use the extrenal IP address and properly forward ports on the router.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

WithoutBrain

  • Newbie
  • *
  • Posts: 20
    • View Profile
    • Email
Re: Network - not LAN connection
« Reply #2 on: November 29, 2016, 01:46:23 pm »
So , i can't use listen(2000)? but i must use it on router?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Network - not LAN connection
« Reply #3 on: November 29, 2016, 02:40:39 pm »
You have to listen on a port on your local PC, but in order for some other client in the internet to connect to you, you need to forward the port on your router to your local PC.

If you don't know what NAT and port forwarding is and have general trouble understanding the basics of networking, I suggest to invest a bit more time in researching the topic. It's a bit more complex and you can't really use a "trial-and-error" message to learn how to write network code.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything