pub struct Client { /* private fields */ }Expand description
Handle to the client side of an SHM communication file
Implementations§
Source§impl Client
impl Client
Sourcepub fn init(file: Box<dyn ShmFileHandle>) -> LGMPResult<Client>
pub fn init(file: Box<dyn ShmFileHandle>) -> LGMPResult<Client>
Initialises a handle to the client side of a LGMP connection given a handle to a memory mapped SHM file. The SHM file and memory mapped region must be large enough to handle all communications, as it cannot be resized during use.
Sourcepub fn client_session_init(&mut self) -> LGMPResult<(Vec<u8>, u32)>
pub fn client_session_init(&mut self) -> LGMPResult<(Vec<u8>, u32)>
Initialises a client session on the already-initialised client.
This will return an error if a host has not already been initialised on the same SHM file. Returns both a copy of the udata byte array set by the host upon startup and the clientID assigned by the host.
Sourcepub fn client_session_valid(&self) -> bool
pub fn client_session_valid(&self) -> bool
Returns true if the session running on the current client is still valid.
This may return false if the host has been restarted or if the last heartbeat recieved from the host has passed the timout (1000ms).
Sourcepub fn client_subscribe(
&mut self,
queue_id: u32,
) -> LGMPResult<ClientQueueHandle>
pub fn client_subscribe( &mut self, queue_id: u32, ) -> LGMPResult<ClientQueueHandle>
Subscribe to the queue indicated by the provided ID.
Returns a handle to the queue if it exists, may alternatively return LGMPErrNoSuchQueue
if a queue does not exist at the provided ID.