Server.__init__¶
-
Server.
__init__
(config_file: str = None, pid_file_name: str = None)[source]¶ Initializes and runs the
Server
object. The constructor calls theconfig()
method to read out the server attributes, and initializes thelogger
and the messageparser
.The method
daemonize()
tries to lock the PID file, and finallyrun()
is called, which starts an endless loop listening on the specified TCPport
.- Parameters
config_file¶ (str, optional) – Configuration file, default is None.
pid_file_name¶ (str, optional) – If given, overrides the default
PID file name
.
- Raises
configparser.Error – Configuration file error
LockError – The PID file could not be locked (see here).
OSError – Various socket errors, e.g. address or timeout