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

Author Topic: sf::socket::Status returning sf::Socket::Error  (Read 2515 times)

0 Members and 1 Guest are viewing this topic.

Voroz

  • Full Member
  • ***
  • Posts: 128
    • View Profile
sf::socket::Status returning sf::Socket::Error
« on: October 29, 2015, 09:02:00 pm »
Hi. I've been trying to get this networking to work for several days now. I started out with a bit more complex project, but did a new project now to see if i could replicate the issue with a minimal example.

If i debug the server and join a client, the socket will work for the first "frame" or step through the program. After that it will stop working and return sf::Socket::Error.

This is my code:
https://gist.github.com/anonymous/508a862ff47f41e1805f


Thanks!

Edit: I didn't store the socket properly, although this was just for this smaller example. My other code still doesn't work.
« Last Edit: October 30, 2015, 01:56:59 am by Voroz »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: sf::socket::Status returning sf::Socket::Error
« Reply #1 on: October 30, 2015, 09:20:13 am »
You could debug the code and see what the OS socket returns as error code. At least that way you might get a bit more information on what went wrong.
Additionally start up Wireshark to see what gets sent around.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Voroz

  • Full Member
  • ***
  • Posts: 128
    • View Profile
Re: sf::socket::Status returning sf::Socket::Error
« Reply #2 on: October 30, 2015, 02:33:18 pm »
I did as you said and tried out wireshark. I tried it first with my chat app, and that worked ok. I received the expected data (in hex), and i then tried my other application, and received a warning called "Zero window".

I looked it up and found out that it means i'm sending too much data. The server runs very fast and is spamming the client with way too much data i believe is my problem. That means that the client will process very old data, especially when it runs at such low fps as 60 compared to the server running super fast.

Does this seem like the probable cause?

Thanks again :).


Edit: I fixed it now so it works. I made the server only send a packet if it just received one from the player.
« Last Edit: October 30, 2015, 02:51:42 pm by Voroz »