![]() |
IRSOL
C++ code implementing socket server for interacting with Baumer camera.
|
Welcome to the irsol::server::handlers
subsystem!
This guide introduces you to the core concepts and practical usage of handlers and the message-handler system in the irsol framework.
Handlers are the building blocks that connect protocol messages (such as commands, assignments, and inquiries) to your application logic. Each handler is responsible for processing a specific type of protocol message and producing an appropriate response.
Handlers are typically implemented as C++ classes (deriving from a base handler template irsol::server::handlers::internal::HandlerBase), but can also be defined as lambda functions for rapid prototyping or simple use cases.
The irsol::server::handlers::MessageHandler is a central registry and dispatcher. It:
MessageHandler
instance, associating it with a message identifier.MessageHandler
looks up the handler for its identifier and invokes it, passing the message and client context.main
file in this folder for a complete example showing:MessageHandler
.Lambda
HandlersFor simple or one-off logic, you can use a lambda handler instead of a full class. This is especially useful for:
For more details, see the documentation in irsol/server/handlers/base.hpp and irsol/server/handlers/lambda_handler.hpp, and the API reference.