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. QWSSocket::connectToLocalFile could not connect:: Connection refused
Forum Updated to NodeBB v4.3 + New Features

QWSSocket::connectToLocalFile could not connect:: Connection refused

Scheduled Pinned Locked Moved Mobile and Embedded
10 Posts 2 Posters 6.8k 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.
  • K Offline
    K Offline
    kumararajas
    wrote on last edited by
    #1

    Hello,

    In my embedded target, when I run the application without QWS Server, I get the following error

    @
    root@am335x-evm:~# ./lab1
    QWSSocket::connectToLocalFile could not connect:: Connection refused
    QWSSocket::connectToLocalFile could not connect:: Connection refused
    QWSSocket::connectToLocalFile could not connect:: Connection refused
    QWSSocket::connectToLocalFile could not connect:: Connection refused
    QWSSocket::connectToLocalFile could not connect:: Connection refused
    QWSSocket::connectToLocalFile could not connect:: Connection refused
    No Qt for Embedded Linux server appears to be running.
    If you want to run this program as a server,
    add the "-qws" command-line option.
    @

    The documentation here is very clear that I need to add "-qws".
    Example:
    @
    ./lab1 -qws
    @

    I understand the necessity of QWS option.

    My question is, when I run the the application without QWS parameter, I get these errors in "Run-time"
    @
    QWSSocket::connectToLocalFile could not connect:: Connection refused
    QWSSocket::connectToLocalFile could not connect:: Connection refused
    QWSSocket::connectToLocalFile could not connect:: Connection refused
    QWSSocket::connectToLocalFile could not connect:: Connection refused
    QWSSocket::connectToLocalFile could not connect:: Connection refused
    QWSSocket::connectToLocalFile could not connect:: Connection refused
    @

    Instead of Qt throwing these errors, I would like to catch them in my application and process them.

    Is there any way to catch these errors in the application?

    Thanks,
    Kumara

    --Kumar

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You need to have one QWS server running to server your (or more) application. So the question is: why don't you want one ?

      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
      • K Offline
        K Offline
        kumararajas
        wrote on last edited by
        #3

        Hi Sam,

        I understand that one QWS server should be in running state.

        And, I would like to have one running always.

        My question is around,
        For some reason, if QWS stops running, then my application would stop abruptly.

        Instead of that, I want to handle that exception in my application. If QWS stops working, then I might want to log an error message in my application logs.

        Hope am clear. Please let me know if you have more questions.

        Thank you,
        Kumara

        --Kumar

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Are you planning on running multiple QWS application on your target ?

          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
          • K Offline
            K Offline
            kumararajas
            wrote on last edited by
            #5

            Sam,

            No. Am not planning to run multiple QWS server in my embedded target.

            My goal is, In my application, identify if QWS server is running or not. If it doesn't run, start QWS from application or show popup message to the user or convey the error message in console.

            --Kumar

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              If you don't run multiple application then you don't need to do that detection since you application will also be the server.

              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
              • K Offline
                K Offline
                kumararajas
                wrote on last edited by
                #7

                OK. That makes sense Sam.

                The reason behind this question is, In my system, there is going to be a main application which spawns all the other processes. In that, one of the process is GUI application.

                It means that, GUI is just optional, other processes will make the product to continue to work.

                Getting back to GUI application being QWS server, The parent process who spawns the GUI process, needs to know the status of QWS server. For some reason, if QWS server stops running, that would result in GUI not being displayed on LCD. So, if parent process knows the status, then it can manage to restart the GUI process again.

                In short, it's sort of mistake proofing (Failure mode detection)

                Please let me know if I was not clear.

                Thanks,
                Kumara

                --Kumar

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  So basically you have two GUI applications, correct ? In that case why not have a third that will be the manager application whom will handle the qws server but nothing else. You other two applications would just be connecting to the server.

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

                  K 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    So basically you have two GUI applications, correct ? In that case why not have a third that will be the manager application whom will handle the qws server but nothing else. You other two applications would just be connecting to the server.

                    K Offline
                    K Offline
                    kumararajas
                    wrote on last edited by
                    #9

                    @SGaist This is exactly what I need. How do I create a manager that would handle qws server and nothing else? Can you give me hint with example?
                    That will be really useful for me.

                    Thank you,
                    Kumara

                    --Kumar

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      For starter, I'd just create a dummy application instantiating a QApplication and calling exec on it. I haven't tried though but I think it should be enough

                      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

                      • Login

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