server.py

tcprocd server.

class tcprocd.server.ThreadedServerDaemonMixin(server_address, RequestHandlerClass, config_file, bind_and_activate=True)[source]

Bases: socketserver.ThreadingMixIn

tcprocd server.

Parameters:
  • server_address
  • RequestHandlerClass
  • config_file
  • bind_and_activate
is_unix_domain = False
daemon_threads = True

daemonize threads

process_request(request, client_address)[source]

Start a new thread to process the request with an appropriate name.

on_runner_exit(name)[source]

Remove runner instance for name.

get_user(username)[source]

Find and return the user object for the given username.

Return None if no user with the given username exists.

Parameters:usernamestr - The username to find and return the user for.
Returns:User | None - The user object, if found.
read_config()[source]

Read and parse the configuration file.

Raise:ConfigurationError
write_config()[source]

Write configuration file.

exception tcprocd.server.ConfigurationError[source]

Bases: Exception

An exception raised when parsing the configuration fails.

class tcprocd.server.TCPServer(server_address, RequestHandlerClass, config_file, bind_and_activate=True)[source]

Bases: tcprocd.server.ThreadedServerDaemonMixin, socketserver.TCPServer

tcprocd tcp server.

allow_reuse_address = True
class tcprocd.server.UnixDomainServer(server_address, RequestHandlerClass, config_file, bind_and_activate=True)[source]

Bases: tcprocd.server.ThreadedServerDaemonMixin, socketserver.UnixStreamServer

tcprocd unix server.

is_unix_domain = True
server_bind()[source]

Override server_bind to set socket options.