CommunicatorWaitFor(ByteBuffer, WaitingTerminateProc, CancellationToken) Method

Sends specified data and waits for the response. The waiting loop will be terminated if waitingTerminateProc returns true. If ByteBuffer data is empty, nothing is sent. Incomming bytes are returned using parametr data (so data parameter cannot be null). The procedure clears ByteBuffer data before start of receiving. If multiple incomming streams should be received without sending output bytes, WaitForWithoutSend method should be used.

Definition

Namespace: OddPrg.Communication
Assembly: OddPrg.Communication (in OddPrg.Communication.dll) Version: 2.0.0.2 (2.0.0.2)
C#
public void WaitFor(
	ByteBuffer data,
	WaitingTerminateProc waitingTerminateProc,
	CancellationToken canceltoken
)

Parameters

data  ByteBuffer
Buffer for outgoing/incomming data
waitingTerminateProc  WaitingTerminateProc
Callback which will decide if all expected data are received.
canceltoken  CancellationToken

See Also