dhcpkit.ipv6.server.control_socket module

A socket to control the DHCPKit server

class dhcpkit.ipv6.server.control_socket.ControlConnection(sock: socket.socket)[source]

Bases: object

A connection of the remote control socket

acknowledge(feedback: str = None)[source]

Acknowledge the command

close()[source]

Close the socket nicely

fileno() → int[source]

The fileno of the listening socket, so this object can be used by select()

Returns:The file descriptor
get_commands() → List[source]

Receive data until the next newline and return the result

Returns:A list of commands
reject()[source]

Reject the command

send(output: str, eol=b'\n')[source]

Send data over the socket

Parameters:
  • output – The data to send
  • eol – The end-of-line character
class dhcpkit.ipv6.server.control_socket.ControlSocket(socket_path: str)[source]

Bases: object

Remote control of the DHCPKit server

accept() → Union[source]

Accept a new connection

Returns:The new connection
close()[source]

Close the socket nicely

fileno() → int[source]

The fileno of the listening socket, so this object can be used by select()

Returns:The file descriptor