class WeaveEchoServer

Defined at line 82 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Profiles/echo/Next/WeaveEchoServer.h

Accepts EchoRequest messages from a peer node and responds with an EchoResponse message.

The WeaveEchoServer class implements the responder side of the Weave Echo protocol. Similar to

the ICMP ping protocol, the Weave Echo protocol can be used to test the liveness and reachability

of a Weave node.

Applications can use the WeaveEchoServer class to enable automatic response to incoming

EchoRequest messages. A corresponding class exists for initiating echo requests (see

WeaveEchoClient).

By default the WeaveEchoServer responds immediately to an EchoRequest with response containing

the same payload as the request. However this behavior can be altered by the application during

processing of the EchoRequestReceived API event.

## API Events

During the course of its operation, the WeaveEchoServer object will call up to the application

to request specific actions or deliver notifications of important events. These API event

calls are made to the currently configured callback function on the server object. Except where

noted, applications are free to alter the state of the server during an event callback. One

overall exception is the object's Shutdown() method, which may never be called during a callback.

The following API events are defined:

### EchoRequestReceived

An EchoRequest message was received from a peer. Arguments to the event contain the request

payload, the exchange context over which the message was received and meta-information about

the request message.

If the application chooses, it may alter the output arguments to the event to force a delay

in responding or to suppress the response altogether. Additionally, it may alter the contents

of the payload buffer, which will become the payload for the response message.

### EchoResponseSent

An EchoResponse message was sent, or failed to be sent. Arguments to the event contain the

error that resulted from sending the message (if any) and the exchange context over which the

message was sent.

Public Members

void * AppState
EchoFunct OnEchoRequestReceived

Public Methods

void WeaveEchoServer ()
WEAVE_ERROR Init (WeaveExchangeManager * exchangeMgr, EventCallback eventCallback, void * appState)
WEAVE_ERROR Shutdown ()
EventCallback GetEventCallback ()

Inline Functions

Documentation for these functions can be found at the end of .cpp file.

Defined at line 176 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Profiles/echo/Next/WeaveEchoServer.h

void SetEventCallback (EventCallback eventCallback)

Defined at line 181 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Profiles/echo/Next/WeaveEchoServer.h

void DefaultEventHandler (void * appState, EventType eventType, const InEventParam & inParam, OutEventParam & outParam)
WEAVE_ERROR Init (WeaveExchangeManager * exchangeMgr)

DEPRECATED APIs -- These APIs provide backwards compatibility with previous versions of WeaveEchoServer.

DO NOT USE IN NEW CODE.

Enumerations

enum EventType
Name Value
kEvent_EchoRequestReceived 1
kEvent_EchoResponseSent 2
kEvent_DefaultCheck 100

Defined at line 89 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Profiles/echo/Next/WeaveEchoServer.h

Records