ESP SDK C API
| Entities/Objects | Functions
Server

 Server Events
 Server Options

Entities/Objects

typedef struct EspServerEvent EspServerEvent
typedef struct EspServerOptions EspServerOptions
typedef struct EspServer EspServer
typedef void(* SERVER_CALLBACK_T )(const EspServerEvent *event, void *user_data)

Functions

ESPAPICALL EspServeresp_server_get (const EspUri *uri, const EspCredentials *cred, const EspServerOptions *server_options, EspError *error)
ESPAPICALL int32_t esp_server_connect (EspServer *server, EspError *error)
ESPAPICALL EspProjectesp_server_get_project (EspServer *server, const char *workspace, const char *project_name, EspProjectOptions *project_options, EspError *error)
ESPAPICALL int32_t esp_server_select_with (EspServer *server, EspSelector *selector, uint32_t events, EspError *error)
ESPAPICALL int32_t esp_server_disconnect (EspServer *server, EspError *error)
ESPAPICALL int32_t esp_server_close (EspServer *server, EspError *error)
ESPAPICALL int32_t esp_server_set_callback (EspServer *server, uint32_t events, SERVER_CALLBACK_T callback, void *user_data, EspError *error)
ESPAPICALL int32_t esp_server_remove_callback (EspServer *server, SERVER_CALLBACK_T callback, EspError *error)

Function Documentation

ESPAPICALL int32_t esp_server_close ( EspServer server,
EspError *  error 
)
ESPAPICALL int32_t esp_server_connect ( EspServer server,
EspError *  error 
)

Connect to the backend cluster. In DIRECT access mode returns when connected. In CALLBACK/SELECT will return immediately. Completion will be indicated by an ESP_SERVER_CONNECTED event.

Returns:
0 on success.
ESPAPICALL int32_t esp_server_disconnect ( EspServer server,
EspError *  error 
)
ESPAPICALL EspServer* esp_server_get ( const EspUri uri,
const EspCredentials cred,
const EspServerOptions server_options,
EspError *  error 
)

Retrieve a EspServer object corresponding to the specified URI.

Returns:
EspServer, NULL on error
Parameters:
uriCluster URI
credcredentials for authentication, NULL if not authenticating
server_optionsOptions to create EspServer with
ESPAPICALL EspProject* esp_server_get_project ( EspServer server,
const char *  workspace,
const char *  project_name,
EspProjectOptions project_options,
EspError *  error 
)
ESPAPICALL int32_t esp_server_remove_callback ( EspServer server,
SERVER_CALLBACK_T  callback,
EspError *  error 
)

Deregisters a callback function on the server.

Returns:
0 on success.
Parameters:
serverEpsServer from which to remove the callback
callbackPreviously registered callback handler
ESPAPICALL int32_t esp_server_select_with ( EspServer server,
EspSelector selector,
uint32_t  events,
EspError *  error 
)

Registers this EspServer with the specified EspSelector. Waiting on the selector will return when the events registered for are triggered.

Returns:
0 on success. Details in case of error
Parameters:
serverThe EspServer object to monitor for events
selectorThe EspSelector to use for monitoring
eventsThe events to monitor for
ESPAPICALL int32_t esp_server_set_callback ( EspServer server,
uint32_t  events,
SERVER_CALLBACK_T  callback,
void *  user_data,
EspError *  error 
)

Registers a callback function on the server.

Returns:
0 on success.
Parameters:
serverEspServer for which to register callbacks
eventsevents to monitor - OR'd ESP_SERVER_EVENT_XXX values
callbackcallback handler function
user_datapointer to data that will be passed back to the registered function
 All Classes Variables