def __init__(self, parent = None):
     QTcpServer.__init__(self, parent)   
     
     # Starts listening on selected port.
     port = 32000
     started = self.listen(address = QHostAddress.Any, port = port)
     
     # It is possible that such port is not available.
     if started:
         print 'Listening on port %s' % port
         
     else:
         print 'Could not bind port %s' % port
     
     # This dictionary will always contains a reference to all 
     #current sockets.
     self.sockets = {}
Example #2
0
    def __init__(self, parent=None):
        QTcpServer.__init__(self, parent)

        # Starts listening on selected port.
        port = 32000
        started = self.listen(address=QHostAddress.Any, port=port)

        # It is possible that such port is not available.
        if started:
            print 'Listening on port %s' % port

        else:
            print 'Could not bind port %s' % port

        # This dictionary will always contains a reference to all
        #current sockets.
        self.sockets = {}
Example #3
0
 def __init__(self, parent=None):
     QTcpServer.__init__(self, parent)
     # all currently connected clients
     self.connections = set()
     # handle new clients
     self.newConnection.connect(self._handle_incoming_connection)
Example #4
0
 def __init__(self, parent=None):
     QTcpServer.__init__(self, parent)
     # all currently connected clients
     self.connections = set()
     # handle new clients
     self.newConnection.connect(self._handle_incoming_connection)