Cooperation/CooperationServer.py

changeset 945
8cd4d08fa9f6
parent 791
9ec2ac20e54e
child 1131
7781e396c903
equal deleted inserted replaced
944:1b59c4ba121e 945:8cd4d08fa9f6
12 12
13 from .Connection import Connection 13 from .Connection import Connection
14 14
15 import Preferences 15 import Preferences
16 16
17
17 class CooperationServer(QTcpServer): 18 class CooperationServer(QTcpServer):
18 """ 19 """
19 Class implementing the cooperation server. 20 Class implementing the cooperation server.
20 21
21 @signal newConnection(connection) emitted after a new connection was received 22 @signal newConnection(connection) emitted after a new connection was received
22 (Connection) 23 (Connection)
23 """ 24 """
24 newConnection = pyqtSignal(Connection) 25 newConnection = pyqtSignal(Connection)
25 26
26 def __init__(self, parent = None): 27 def __init__(self, parent=None):
27 """ 28 """
28 Constructor 29 Constructor
29 30
30 @param parent reference to the parent object (QObject) 31 @param parent reference to the parent object (QObject)
31 """ 32 """
39 """ 40 """
40 connection = Connection(self) 41 connection = Connection(self)
41 connection.setSocketDescriptor(socketDescriptor) 42 connection.setSocketDescriptor(socketDescriptor)
42 self.newConnection.emit(connection) 43 self.newConnection.emit(connection)
43 44
44 def startListening(self, port = -1): 45 def startListening(self, port=-1):
45 """ 46 """
46 Public method to start listening for new connections. 47 Public method to start listening for new connections.
47 48
48 @param port port to listen on (integer) 49 @param port port to listen on (integer)
49 @return tuple giving a flag indicating success (boolean) and 50 @return tuple giving a flag indicating success (boolean) and

eric ide

mercurial