fort::hermes::NetworkContext¶
-
class NetworkContext : public fort::hermes::Context¶
A Context that reads FrameReadout from a live leto instance.
Public Functions
-
NetworkContext(const std::string &host, int port = 4002, bool nonblocking = false)¶
Opens a leto broadcast.
- Parameters
host – the host to connect to
port – the port to connect to, usually 4002
nonblocking – if true the connection will be non-blocking, meaning that WouldBlock can be thrown if no message are ready when Reading
- Throws
asio::system_error – if no connection could be made
InternalError – if no valid header is found in the stream
-
virtual void Read(fort::hermes::FrameReadout *ro)¶
Reads a FrameReadout from the Context.
- Parameters
ro – the FrameReadout to parse to
- Throws
EndOfFile – if the Context does not contains any other data
UnexpectedEndOfFileSequence – if a sequence of files does not end up gracefully
WouldBlock – if a non-blocking connection has no messages yet ready.
InternalError – if any other error occured
-
NetworkContext(const std::string &host, int port = 4002, bool nonblocking = false)¶