Robot Raconteur Core C++ Library
Loading...
Searching...
No Matches
RobotRaconteur::ServerEndpoint Class Reference

Server endpoint representing a client connection. More...

#include <Service.h>

Static Public Member Functions

static boost::shared_ptr< ServerEndpoint > GetCurrentEndpoint ()
 Returns the current server endpoint.
static boost::shared_ptr< AuthenticatedUserGetCurrentAuthenticatedUser ()
 Returns the current authenticated user.

Detailed Description

Server endpoint representing a client connection.

Robot Raconteur creates endpoint pairs between a client and service. For clients, this endpoint is a ClientContext. For services, the endpoint becomes a ServerEndpoint. ServerEndpoints are used to address a specific client connected to a service, since services may have multiple clients connected concurrently. ServerEndpoints also provide client authentication information.

Use ServerEndpoint::GetCurrentEndpoint()->GetLocalEndpoint() to retrieve the uint32_t current endpoint ID. Use ServerEndpoint::GetCurrentAuthenticatedUser() to retrieve the current user authentication information.

Member Function Documentation

◆ GetCurrentAuthenticatedUser()

boost::shared_ptr< AuthenticatedUser > RobotRaconteur::ServerEndpoint::GetCurrentAuthenticatedUser ( )
static

Returns the current authenticated user.

Users that have been authenticated have a corresponding AuthenticatedUser object associated with the ServerEndpoint. GetCurrentAuthenticatedUser() returns the AuthenticatedUser associated with the current ServerEndpoint during a request or packet event. This is a thread-specific value and only valid during the initial request or packet event invocation.

Throws PermissionDeniedException or AuthenticationException if there is no AuthenticatedUser set in the current thread.

Returns
RR_SHARED_PTR<AuthenticatedUser> The AuthenticatedUser

◆ GetCurrentEndpoint()

boost::shared_ptr< ServerEndpoint > RobotRaconteur::ServerEndpoint::GetCurrentEndpoint ( )
static

Returns the current server endpoint.

Returns the current server endpoint during a request or packet event. This is a thread-specific value and only valid during the initial request or packet event invocation.

Throws InvalidOperationException if not during a request or packet event

Returns
RR_SHARED_PTR<ServerEndpoint> The current server endpoint

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