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. Check qws server
Qt 6.11 is out! See what's new in the release blog

Check qws server

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 3 Posters 4.6k Views 1 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.
  • L Offline
    L Offline
    luca
    wrote on last edited by
    #1

    My embedded application need to know if there is a running qws server .

    My application can be started one or two times at the same time.

    The application must be started for the first time with -qws parameter while the second time without -qws:
    @
    ./app -qws &
    (first application started)
    ./app &
    (second application started)
    @

    I'd like to always start application without -qws, check in the main() if -qws is required and then restart application with right parameter.

    For example:
    @
    int main(int argc, char *argv[])
    {
    ...
    ...
    if(qwsRequired())
    {
    QProcess::startDetached(QApplication::applicationFilePath(), parameter_list);
    exit(12);
    }
    ...
    }
    @
    I need qwsRequired() .

    1 Reply Last reply
    0
    • I Offline
      I Offline
      Immii
      wrote on last edited by
      #2

      I dont know of any api which tells you whether qws is running or not, but may be in script you can find with ps and then use that. i know this may not be the answer you wold be looking for but this what comes to my mind

      1 Reply Last reply
      0
      • V Offline
        V Offline
        vcsala
        wrote on last edited by
        #3

        Or you can use some kind of "lock" file mechanism (similar to the daemons running on linux, storing their pid in a file, which can be checked if it does exist or not)

        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