Skip to content

TActiveRequest<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>

Represents a one-to-one connection to a client holding the corresponding PendingResponse that is coupled with the TRequestMut the client sent to the server. The server will use it to send arbitrary many responses.

Definition

Unit: Neslib.Iceoryx2.RequestResponse

type TActiveRequest<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr> = record ... end;

Type Parameters

TReqPayl:

TReqUsrHdr:

TRespPayl:

TRespUsrHdr:

Nested Types

Name Description
PRequestPayload
PRequestUserHeader
PResponsePayload
PResponseUserHeader
TRequestPayload
TRequestUserHeader
TResponsePayload
TResponseUserHeader

Properties

Name Description
Handle

Constructors

Name Description
Assign
Finalize
Initialize

Operators

Name Description
Equal
NotEqual

Methods

Name Description
HasDisconnectHint Returns True if the TClient wants to gracefully disconnect. This allows the TServer to send its last response and then drop the TActiveRequest to signal the client that no more TResponseMut's will be sent.
Header Returns the TRequestHeader of the received TRequestMut.
IsConnected Returns True until the TPendingResponse goes out of scope on the TClient side indicating that the client no longer receives the TResponseMut.
Loan Loans default initialized memory for a TResponseMut where the user can write its payload to.
LoanSlice Loans default initialized memory for a TResponseMut where the user can write its payload to.
LoanSliceUninit Loans uninitialized memory for a TResponseMutUninit where the user can write its payload to.
LoanUninit Loans uninitialized memory for a TResponseMutUninit where the user can write its payload to.
Origin Returns the TUniqueClientId of the TClient
Payload Returns a reference to the payload of the received TRequestMut.
PayloadSlice<T> Returns a reference to the payload slice of the received TRequestMut.
Release Manually releases the request.
SendCopy Sends a copy of the provided data to the PendingResponse of the corresponding client. This is not a zero-copy API. Use TActiveRequest.LoanUninit instead.
SendSliceCopy Sends a copy of the provided data to the PendingResponse of the corresponding client. This is not a zero-copy API. Use TActiveRequest.LoanSliceUninit instead.
UserHeader Returns a reference to the user header of the received TRequestMut.

Property Descriptions

Handle

property Handle: THandle read GetHandle

Type: THandle


Constructor Descriptions

Assign

constructor Assign(var ADest: TActiveRequest<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>; const ASrc: TActiveRequest<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>)

Parameters

ADest: TActiveRequest<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>

ASrc: TActiveRequest<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>


Finalize

destructor Finalize


Initialize

constructor Initialize


Operator Descriptions

Equal(TActiveRequest, Pointer)

class operator Equal(const ALeft: TActiveRequest<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>; const ARight: Pointer): Boolean; inline; static

Parameters

ALeft: TActiveRequest<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>

ARight: Pointer

Returns

Boolean


NotEqual(TActiveRequest, Pointer)

class operator NotEqual(const ALeft: TActiveRequest<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>; const ARight: Pointer): Boolean; inline; static

Parameters

ALeft: TActiveRequest<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>

ARight: Pointer

Returns

Boolean


Method Descriptions

HasDisconnectHint

Returns True if the TClient wants to gracefully disconnect. This allows the TServer to send its last response and then drop the TActiveRequest to signal the client that no more TResponseMut's will be sent.

function HasDisconnectHint: Boolean; inline

Returns

Boolean


Returns the TRequestHeader of the received TRequestMut.

function Header: TRequestHeader; inline

Returns

TRequestHeader


IsConnected

Returns True until the TPendingResponse goes out of scope on the TClient side indicating that the client no longer receives the TResponseMut.

function IsConnected: Boolean; inline

Returns

Boolean


Loan

Loans default initialized memory for a TResponseMut where the user can write its payload to.

function Loan: TResult<TResponseMut<TRespPayl>, TLoanError>; inline

Returns

TResult<TResponseMut<TRespPayl>, TLoanError>

Remarks

Cannot be used when TResponsePayload is a slice (TSlice). This is checked with an assertion. Otherwise use LoanSlice instead.


LoanSlice(UInt64)

Loans default initialized memory for a TResponseMut where the user can write its payload to.

function LoanSlice(const ANumerOfElements: UInt64): TResult<TResponseMut<TRespPayl>, TLoanError>; inline

Parameters

ANumerOfElements: UInt64

Returns

TResult<TResponseMut<TRespPayl>, TLoanError>

Remarks

Can only be used when TResponsePayload is a slice (TSlice). This is checked with an assertion. Otherwise use Loan instead.


LoanSliceUninit(UInt64)

Loans uninitialized memory for a TResponseMutUninit where the user can write its payload to.

function LoanSliceUninit(const ANumerOfElements: UInt64): TResult<TResponseMutUninit<TRespPayl>, TLoanError>; inline

Parameters

ANumerOfElements: UInt64

Returns

TResult<TResponseMutUninit<TRespPayl>, TLoanError>

Remarks

Can only be used when TResponsePayload is a slice (TSlice). This is checked with an assertion. Otherwise use LoanUnit instead.


LoanUninit

Loans uninitialized memory for a TResponseMutUninit where the user can write its payload to.

function LoanUninit: TResult<TResponseMutUninit<TRespPayl>, TLoanError>; inline

Returns

TResult<TResponseMutUninit<TRespPayl>, TLoanError>

Remarks

Cannot be used when TResponsePayload is a slice (TSlice). This is checked with an assertion. Otherwise use LoanSliceUnit instead.


Origin

Returns the TUniqueClientId of the TClient

function Origin: TUniqueClientId; inline

Returns

TUniqueClientId


Payload

Returns a reference to the payload of the received TRequestMut.

function Payload: PRequestPayload; inline

Returns

PRequestPayload

Remarks

Cannot be used when TRequestPayload is a slice (TSlice). This is checked with an assertion. Otherwise use PayloadSlice instead.


PayloadSlice<T>

Returns a reference to the payload slice of the received TRequestMut.

function PayloadSlice<T>: TSlice<T>; inline

Type Parameters

T:

Returns

TSlice<T>

Remarks

Can only be used when TRequestPayload is a slice (TSlice). This is checked with an assertion. Otherwise use Payload instead.

The type parameter T must be the element type of the slice. E.g. if TRequestPayload = TSlice<word>, then T must be Word. This is checked with an assertion.


Release

Manually releases the request.

procedure Release; inline


SendCopy(TResponsePayload)

Sends a copy of the provided data to the PendingResponse of the corresponding client. This is not a zero-copy API. Use TActiveRequest.LoanUninit instead.

function SendCopy(const APayload: TResponsePayload): TResult<Void, TSendError>; inline

Parameters

APayload: TResponsePayload

Returns

TResult<Void, TSendError>

Remarks

Cannot be used when TResponsePayload is a slice (TSlice). This is checked with an assertion. Otherwise use SendSliceCopy instead.


SendSliceCopy(TResponsePayload)

Sends a copy of the provided data to the PendingResponse of the corresponding client. This is not a zero-copy API. Use TActiveRequest.LoanSliceUninit instead.

function SendSliceCopy(const APayload: TResponsePayload): TResult<Void, TSendError>; inline

Parameters

APayload: TResponsePayload

Returns

TResult<Void, TSendError>

Remarks

Can only be used when TResponsePayload is a slice (TSlice). This is checked with an assertion. Otherwise use LoanUnit instead.


UserHeader

Returns a reference to the user header of the received TRequestMut.

function UserHeader: PRequestUserHeader; inline

Returns

PRequestUserHeader

Remarks

Cannot be used when there is no TRequestUserHeader (that is, when TRequestUserHeader=Void). This is checked with an assertion.