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

Author Topic: Server not working over INTERNET  (Read 2178 times)

0 Members and 1 Guest are viewing this topic.

Walta69

  • Newbie
  • *
  • Posts: 30
    • View Profile
Server not working over INTERNET
« on: May 07, 2014, 04:30:59 pm »
Hi,

I made a TCP server. The server works PERFECTLY when i connect to it on my local PC. As soon as I gave the
client program to my friends and they try to connect, it works sometimes but other times it just stops
working.

My ports are forwarded.

Anything that you could suggest that I am doing wrong?/

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Server not working over INTERNET
« Reply #2 on: May 07, 2014, 05:06:05 pm »
Does it fail during connection establishment or later?
What states are the sockets in when the problem occurs?
What errors do you get from the sockets? From SFML?
Have you tried to inspect your code with a debugger to check that it actually does what you intend it to?

Also be aware that latency can vary a LOT on the internet. Latency spikes of hundreds (even thousands) of milliseconds are rather common. If your program somehow depends on timely delivery of packets you will have problems.

If you are going through NAT somewhere that can cause problems. I've personally seen lots of examples of crappy private broadband routers that happily drop entries in their (very small) NAT tables when they run low on resources.

The internet is basically crap and getting relyable performance there is HARD.

Walta69

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Server not working over INTERNET
« Reply #3 on: May 07, 2014, 05:13:13 pm »
Ok I think im sort of getting to the solution. It MAY be a problem with my code.

The server is fine when clients are connecting to it. It runs perfectly. As soon as a client leaves it causes
issues for other clients trying to connect.

 

anything