communication.CommandServer Class Reference

QTcpServer class used to receive commands and execute them. More...

Inheritance diagram for communication.CommandServer:

Public Member Functions

def __init__ (self, parent=None)
 Initialization method for CommandServer. More...
 
def incomingConnection (self, socketDescriptor)
 Method to handle an incoming connection by dispatching a CommandThread. More...
 
def close (self)
 Method used to close the CommandServer and inform user about it.
 

Detailed Description

QTcpServer class used to receive commands and execute them.

This class is used by a ServerProxy instance to provide the interprocess communication between itself and outside client.

Definition at line 199 of file communication.py.

Constructor & Destructor Documentation

◆ __init__()

def communication.CommandServer.__init__ (   self,
  parent = None 
)

Initialization method for CommandServer.

A class instance is created.

Parameters
parentA reference to an instance which will take servers's ownership.

Definition at line 208 of file communication.py.

208  def __init__(self, parent=None):
209  super(CommandServer, self).__init__(parent)
210 

Member Function Documentation

◆ incomingConnection()

def communication.CommandServer.incomingConnection (   self,
  socketDescriptor 
)

Method to handle an incoming connection by dispatching a CommandThread.

This method is called by Qt when an incoming connection with a socket descriptor is received. A new CommandThread is created to serve to a received request from the socket description. The CommandThread is set to terminate when finished and then started.

Parameters
socketDescriptorA Qt's qintptr socket descriptor to initialize tcpSocket.

Definition at line 222 of file communication.py.

222  def incomingConnection(self, socketDescriptor):
223  thread = CommandThread(socketDescriptor, self)
224  thread.finished.connect(thread.deleteLater)
225  thread.start()
226 

The documentation for this class was generated from the following file: