Public Member Functions | |
| def | __init__ |
| def | waitForClients |
| def | connect |
| def | run |
| def | sendOrder |
| def | broadcast |
Public Attributes | |
| handle | |
| pluginHandle | |
| loop | |
| connections | |
| server | |
This class is the task of the server that manages clients connections on his port. It keeps the list of connected clients and provides method to broadcast messages to all the clients.
| def shared.network.NetworkServer.__init__ | ( | self, | |
| handle, | |||
| pluginHandle, | |||
| loop | |||
| ) |
The server listen on the port specified in const.py.
| def shared.network.NetworkServer.run | ( | self | ) |
When a client tries to connect, the server adds him to the list and creates a new task managing communications with this client.
| def shared.network.NetworkServer.sendOrder | ( | self, | |
| ident, | |||
| order | |||
| ) |
Send an order to all connected clients by broadcasting messages to all threads in the list.
| def shared.network.NetworkServer.waitForClients | ( | self, | |
| n | |||
| ) |
Block until n clients are connected
1.7.6.1