Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Client/Server with a lot of connections

    General and Desktop
    socket
    3
    4
    1039
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      Alux last edited by

      Dear ALL users
      I am new to this forum and hope that could find out any solution about my problem

      I wrote a Client/Server application that works like messengers programs

      Each client make tcp socket connection to the server and send their data.

      My program works find with my test environment that consist of 15 clients

      The problem occurs when client connection increase and it seems that my server misses some of them

      For example when I try to send packet from different client ( 100 Client ) to my server , server shows that only 90 client connected and 10 client is not connected,

      Another issues is that a server maybe loss packet from client that make a lot of connections to servers

      Is there any idea about this issues? Any point that I should considered?

      Thanks for your attentions

      1 Reply Last reply Reply Quote 0
      • mrdebug
        mrdebug last edited by

        Sorry but this question is too generic. Are you using event ot thread approach?

        Need programmers to hire?
        www.labcsp.com
        www.denisgottardello.it
        GMT+1
        Skype: mrdebug

        A 1 Reply Last reply Reply Quote 0
        • A
          Alux @mrdebug last edited by

          @mrdebug

          Yes, i'm using thread

          im using qtcpsocket ( Listener as server )

          when a connection socket received from client, server received client data

          a part of my code is

          void NetworkManager::incomingConnection(int socketfd)
          {
          QTcpSocket *client = new QTcpSocket(this);
          client->setSocketDescriptor(socketfd);
          clients.insert(client);
          qDebug() « "new connection from new client";
          client->peerAddress().toString());
          connect(client, SIGNAL(readyRead()), this, SLOT(readyRead()));
          connect(client, SIGNAL(disconnected()), this, SLOT(disconnected()));
          }

          1 Reply Last reply Reply Quote 0
          • A
            AlexRoot last edited by

            We would need the whole implementation and debug it. But I guess it would be more productive when you watch some tutorial about high performance TCP server designs and stuff. This is a nice tutorial I can recommend: https://www.youtube.com/watch?v=zMgbVN3uQ-E

            Cheers

            1 Reply Last reply Reply Quote 0
            • First post
              Last post