Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to check server connection on client side
Forum Updated to NodeBB v4.3 + New Features

How to check server connection on client side

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 4 Posters 1.3k Views
  • 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.
  • Y YtreioJ

    Hi,
    How to check connection with remote server from the client side? Maybe something like ping, or from Qt networking? linux

    ODБOïO Offline
    ODБOïO Offline
    ODБOï
    wrote on last edited by ODБOï
    #2

    @YtreioJ which server are you talking about ? what is the protocol ?

    Y 1 Reply Last reply
    4
    • ODБOïO ODБOï

      @YtreioJ which server are you talking about ? what is the protocol ?

      Y Offline
      Y Offline
      YtreioJ
      wrote on last edited by
      #3

      Ip, i wanna something like ping in the console, which would return true, if server or tunnel is available

      Pablo J. RoginaP 1 Reply Last reply
      0
      • Y YtreioJ

        Ip, i wanna something like ping in the console, which would return true, if server or tunnel is available

        Pablo J. RoginaP Offline
        Pablo J. RoginaP Offline
        Pablo J. Rogina
        wrote on last edited by
        #4

        @YtreioJ simply telnet to the host at the service port, if service is listening you'll have at least a connection... to check a Squid server is listening on port 3128 do:

        telnet hostname/ip_address 3128
        

        Upvote the answer(s) that helped you solve the issue
        Use "Topic Tools" button to mark your post as Solved
        Add screenshots via postimage.org
        Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

        Y 1 Reply Last reply
        1
        • Pablo J. RoginaP Pablo J. Rogina

          @YtreioJ simply telnet to the host at the service port, if service is listening you'll have at least a connection... to check a Squid server is listening on port 3128 do:

          telnet hostname/ip_address 3128
          
          Y Offline
          Y Offline
          YtreioJ
          wrote on last edited by
          #5

          @Pablo-J.-Rogina How to use it? From which library? Examples?

          ODБOïO 1 Reply Last reply
          0
          • Y YtreioJ

            @Pablo-J.-Rogina How to use it? From which library? Examples?

            ODБOïO Offline
            ODБOïO Offline
            ODБOï
            wrote on last edited by ODБOï
            #6

            @YtreioJ One way to do it is to create your script and then execute it from your app using QProcess

            can help : https://github.com/edhana/qt-ping-example

            Y 1 Reply Last reply
            2
            • ODБOïO ODБOï

              @YtreioJ One way to do it is to create your script and then execute it from your app using QProcess

              can help : https://github.com/edhana/qt-ping-example

              Y Offline
              Y Offline
              YtreioJ
              wrote on last edited by
              #7

              @LeLev yes, i've tried to create external script with ping command, but how to make him return true/false

              ODБOïO JonBJ 2 Replies Last reply
              0
              • Y YtreioJ

                @LeLev yes, i've tried to create external script with ping command, but how to make him return true/false

                ODБOïO Offline
                ODБOïO Offline
                ODБOï
                wrote on last edited by
                #8

                @YtreioJ said in How to check server connection on client side:

                but how to make him return true/false

                do you mean :
                how to return true or false in your script ?
                or
                how your app will see the result of executed process ?

                Could you please detail a bit more your questions every time ?

                Y 1 Reply Last reply
                2
                • ODБOïO ODБOï

                  @YtreioJ said in How to check server connection on client side:

                  but how to make him return true/false

                  do you mean :
                  how to return true or false in your script ?
                  or
                  how your app will see the result of executed process ?

                  Could you please detail a bit more your questions every time ?

                  Y Offline
                  Y Offline
                  YtreioJ
                  wrote on last edited by
                  #9

                  @LeLev yeah, how my app will see the result?

                  ODБOïO 1 Reply Last reply
                  0
                  • Y YtreioJ

                    @LeLev yeah, how my app will see the result?

                    ODБOïO Offline
                    ODБOïO Offline
                    ODБOï
                    wrote on last edited by
                    #10

                    @YtreioJ
                    check the official doc:
                    may be

                    //QByteArray QProcess::readAllStandardOutput()
                    QString output(theProcess.readAllStandardOutput());
                    
                    1 Reply Last reply
                    4
                    • Y YtreioJ

                      @LeLev yes, i've tried to create external script with ping command, but how to make him return true/false

                      JonBJ Offline
                      JonBJ Offline
                      JonB
                      wrote on last edited by
                      #11

                      @YtreioJ

                      @LeLev yes, i've tried to create external script with ping command, but how to make him return true/false

                      Have you looked at the docs for whatever external ping command you are using to see if perhaps its exit code tells you anything about success?

                      1 Reply Last reply
                      0

                      • Login

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