Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Client Not connect at real external Device
Forum Updated to NodeBB v4.3 + New Features

Client Not connect at real external Device

Scheduled Pinned Locked Moved Solved Mobile and Embedded
5 Posts 3 Posters 581 Views 2 Watching
  • 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.
  • Nio74N Offline
    Nio74N Offline
    Nio74
    wrote on last edited by
    #1

    Good Day,

    Hi I am testing my client application externally with an android device but it does not connect to the server, if I test on the same machine in debug it connects perfectly, but if I install the app on the android device it does not connect, I have tried also to do the test with the server on a fixed PC and put the client on a laptop (believing it to be a god permission problem on the manifest) but it doesn't even work this way. I want to point out that on the server I opened the firewall on the incoming port and exit 6547.

    Server:

    QString Backend::startServer()
    {
        if (!server->tcpServer->listen(QHostAddress::Any, 6547))
        {
            return "Error! The port is taken by some other service";
        }
        else
        {
            connect(server->tcpServer, &QTcpServer::newConnection, server, &ClientResearch::newConnection);
            //server->connectDb();
            return "Server started, port is openned";
        }
    }
    

    Client:

     client = new ClientResearch("192.168.1.8",6547);
    
    

    void ClientResearch::connect2host()
    {

    bool conSock = tcpSocket->state()== QTcpSocket::ConnectedState;
    
    if(! conSock )
    {
    timeoutTimer->start(3000);
    
    tcpSocket->connectToHost(host, port);
    connect(tcpSocket, &QTcpSocket::connected, this, &ClientResearch::connected);
    connect(tcpSocket, &QTcpSocket::readyRead, this, &ClientResearch::readyRead);
    }else {
        qDebug() << "socket already connect";
    

    }

    }

    
    Where am I Wrong?
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Is your device connected to the same network as your computer ?
      By firewall, do you mean the one installed on your computer ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • Nio74N Offline
        Nio74N Offline
        Nio74
        wrote on last edited by
        #3

        @SGaist said in Client Not connect at real external Device:

        Hi,

        Is your device connected to the same network as your computer ?
        By firewall, do you mean the one installed on your computer ?

        1 Yes my device connected to the same network, I have try at ping "192.168.1.8" but not work
        2 Firewall of windows I have disabled but not ping
        3 I'm trying to solve the problem but I haven't succeeded yet

        1 Reply Last reply
        0
        • A Offline
          A Offline
          arsinte_andrei
          wrote on last edited by
          #4

          Re: Client Not connect at real external Device

          If you do not have any ping at all I do suspect your router firewall settings or port blocking on your router. code wise is looking ok as long as the server is at 192.168.1.8 ...

          1 Reply Last reply
          1
          • Nio74N Offline
            Nio74N Offline
            Nio74
            wrote on last edited by
            #5

            I solved,the problem was in the router,the wifi was isolated

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved