RTI Connext C# API  7.1.0
SimpleReplier< TRequest, TReply > Class Template Reference

A simplified version of Replier that can be used to reply to incoming requests on an individual basis. More...

Properties

DataReader< TRequest > RequestReader [get]
 The underlying DataReader<TRequest> used to read requests. More...
 
DataWriter< TReply > ReplyWriter [get]
 The underlying DataWriter<TReply> used to send replies. More...
 

Detailed Description

A simplified version of Replier that can be used to reply to incoming requests on an individual basis.

Template Parameters
TRequestThe type of the requests to be received.
TReplyThe type of the replies to be sent.

A SimpleReplier is based on an event handler. Requests are passed to the handler, which returns a reply. The reply is directed only to the Requester that sent the request. SimpleRepliers are useful for simple use cases where a single reply for a request can be generated quickly, for example, looking up a table. When more than one reply for a request can be generated or the processing is complex or needs to happen asynchronously, use a Replier instead.

Use participant.BuildSimpleReplier<TRequest, TReply>() (an extension method defined in DomainParticipantRequestReplyExtensions) to configure and build a SimpleReplier.

For example, to create a SimpleReplier:

var simpleReplier = participant.BuildSimpleReplier<FooRequest, FooReply>()
.WithServiceName("FooService")
.WithRequestHandler(request => new FooReply(request)")
.Create();

See also Request-Reply Examples.

Property Documentation

◆ ReplyWriter

DataWriter<TReply> ReplyWriter
get

The underlying DataWriter<TReply> used to send replies.

◆ RequestReader

DataReader<TRequest> RequestReader
get

The underlying DataReader<TRequest> used to read requests.