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

Author Topic: sf::SocketSelector::wait() bug  (Read 2172 times)

0 Members and 1 Guest are viewing this topic.

lorence30

  • Full Member
  • ***
  • Posts: 124
    • View Profile
    • Email
sf::SocketSelector::wait() bug
« on: November 15, 2015, 11:02:50 am »
ive been fixing this for few hours:

this first snippet should output "Test" if a client is attempting to connect to server or a client is sending a packet, but it doest output "Test"
void ServerManager::socketSignal()
{
    if ( selector.wait() )
    {
        qDebug() << "Test";
        if ( selector.isReady(server) )
        {
            acceptClient();
        }
        else
        {
            receiveAndSendPacket();
        }
    }
}

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    ServerManager server;
    while(true)
    {
        server.socketSignal();
    }
}
 

when i do this:
it works
int main()
{
    while(true)
    if ( selector.wait( ) )
    {
        qDebug() << "test";
    }

}

i dont know whats happening.
in the first snippet i tested if socketSignal() is executing, and yes its executing.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11016
    • View Profile
    • development blog
    • Email
Re: sf::SocketSelector::wait() bug
« Reply #1 on: November 15, 2015, 04:56:21 pm »
Start Wireshark and check what is being sent (or not sent).

Additionally I think we have told you before, unless you provide a minimal but compilable example, there's little we can do to help you... ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/