Class ServiceServer
Defined in File service_server.hpp
Inheritance Relationships
Base Type
public email::ServiceObject
(Class ServiceObject)
Class Documentation
-
class ServiceServer : public email::ServiceObject
Service server.
Gets a request from a client and sends a response.
Public Functions
-
explicit ServiceServer(const std::string &service_name)
Constructor.
- Parameters:
service_name – the service name
-
~ServiceServer()
-
bool has_request()
Check if the server has an available request.
- Returns:
true if there is an available request, false otherwise
-
std::optional<struct ServiceRequest> get_request()
Get a request if there is one.
- Returns:
the request, or
std::nullopt
if there is none
-
std::optional<std::pair<struct ServiceRequest, ServiceInfo>> get_request_with_info()
Get a request with info if there is one.
- Returns:
the request with info, or
std::nullopt
if there is none
-
void send_response(const struct ServiceRequestId &request_id, const std::string &response)
Send response.
- Parameters:
request_id – the original request ID
response – the response
-
explicit ServiceServer(const std::string &service_name)