corda / net.corda.core.flows / FlowSession / receive

receive

@Suspendable fun <reified R : Any> receive(): UntrustworthyData<R>

Suspends until counterparty sends us a message of type R.

Remember that when receiving data from other parties the data should not be trusted until it's been thoroughly verified for consistency and that all expectations are satisfied, as a malicious peer may send you subtly corrupted data in order to exploit your code.

@Suspendable abstract fun <R : Any> receive(receiveType: Class<R>, maySkipCheckpoint: Boolean): UntrustworthyData<R>

Suspends until counterparty sends us a message of type receiveType.

Remember that when receiving data from other parties the data should not be trusted until it's been thoroughly verified for consistency and that all expectations are satisfied, as a malicious peer may send you subtly corrupted data in order to exploit your code.

Parameters

maySkipCheckpoint - setting it to true indicates to the platform that it may optimise away the checkpoint.

Return
an UntrustworthyData wrapper around the received object.

@Suspendable abstract fun <R : Any> receive(receiveType: Class<R>): UntrustworthyData<R>

Suspends until counterparty sends us a message of type receiveType.

Remember that when receiving data from other parties the data should not be trusted until it's been thoroughly verified for consistency and that all expectations are satisfied, as a malicious peer may send you subtly corrupted data in order to exploit your code.

Return
an UntrustworthyData wrapper around the received object.