Ark
Loading...
Searching...
No Matches
comm_infrastructure.registry.Registry Class Reference
Inheritance diagram for comm_infrastructure.registry.Registry:

Public Member Functions

 __init__ (self, str registry_host="127.0.0.1", int registry_port=1234, int lcm_network_bounces=1)
 Initialize the Registry server instance.
 start (self)
 Start the server and monitor for errors.

Public Attributes

dict services = {}
 lock = threading.Lock()
bool error_flag = False
 thread = None
 get_info_service = None
 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 registry_host
 registry_port

Protected Member Functions

 _callback_get_network_info (self, channel, msg)
 Aggregate information about all nodes in the network.
 _serve (self)
 Main loop handling incoming registry requests.
 _recvall (self, conn, n)
 Receive n bytes from a connection.
 _handle_request (self, request)
 Handle an incoming registry request.
 _stop (self)
 Stop the server and wait for the serving thread to finish.

Protected Attributes

 _stop_event = threading.Event()

Constructor & Destructor Documentation

◆ __init__()

comm_infrastructure.registry.Registry.__init__ ( self,
str registry_host = "127.0.0.1",
int registry_port = 1234,
int lcm_network_bounces = 1 )

Initialize the Registry server instance.

Parameters
registry_hostHost address for the registry.
registry_portPort on which the registry listens.
lcm_network_bouncesTTL for LCM multicast messages.

Member Function Documentation

◆ _callback_get_network_info()

comm_infrastructure.registry.Registry._callback_get_network_info ( self,
channel,
msg )
protected

Aggregate information about all nodes in the network.

Parameters
channelUnused service channel name.
msgService request message.
Returns
: Populated :class:network_info_t message.

◆ _handle_request()

comm_infrastructure.registry.Registry._handle_request ( self,
request )
protected

Handle an incoming registry request.

Parameters
requestParsed request dictionary.
Returns
: Response dictionary to send back to the client.

◆ _recvall()

comm_infrastructure.registry.Registry._recvall ( self,
conn,
n )
protected

Receive n bytes from a connection.

Parameters
connSocket connection.
nNumber of bytes to receive.
Returns
: The received bytes or None if EOF is hit.

◆ _serve()

comm_infrastructure.registry.Registry._serve ( self)
protected

Main loop handling incoming registry requests.

This method listens on the configured host and port, processing registration, deregistration and discovery requests from clients.

◆ _stop()

comm_infrastructure.registry.Registry._stop ( self)
protected

Stop the server and wait for the serving thread to finish.

Returns
: None

◆ start()

comm_infrastructure.registry.Registry.start ( self)

Start the server and monitor for errors.

This method blocks until the server stops or encounters a fatal error.

Member Data Documentation

◆ _stop_event

comm_infrastructure.registry.Registry._stop_event = threading.Event()
protected

◆ error_flag

bool comm_infrastructure.registry.Registry.error_flag = False

◆ get_info_service

comm_infrastructure.registry.Registry.get_info_service = None

◆ lock

comm_infrastructure.registry.Registry.lock = threading.Lock()

◆ registry_host

comm_infrastructure.registry.Registry.registry_host

◆ registry_port

comm_infrastructure.registry.Registry.registry_port

◆ s

comm_infrastructure.registry.Registry.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

◆ services

dict comm_infrastructure.registry.Registry.services = {}

◆ thread

comm_infrastructure.registry.Registry.thread = None

The documentation for this class was generated from the following file: