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. QTcpServer, multi-threads VS multi-processes

QTcpServer, multi-threads VS multi-processes

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.2k 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

    Hi all,
    I have an application that handles every new tcp connection with a new thread. I get this by sub-classing QTcpServer::incomingConnection as usual and passing the QTcoSocket to a new thread.

    Now I'd like to have a new process for every socket. This way if one of the processes crashes (I'd like it never happens ) I get the others running.

    The problem is that I don't understand how to pass the socket to a new process...

    Do you think it's possible?

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      Socket end point is local kernel/tcp-ip resource. This can't be passed across the process address space. I think your idea is to provide High availability. You need to look for other mechanism for doing your objective.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • L Offline
        L Offline
        luca
        wrote on last edited by
        #3

        What do you think about "fork" my application for every client connection?

        Have someone already tried?

        It seems Apache works like this.

        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