iOS Guides | Samples

Network.NWConnectionReceiveCompletion Delegate

Signature for receiving data from NWConnection’s NWConnection.Receive or NWConnection.ReceiveMessage method.

Syntax

public delegate Void NWConnectionReceiveCompletion (IntPtr data,nuint dataSize,NWContentContext context,Boolean isComplete,NWError error)

Parameters

data
Pointer to the received data or IntPtr.Zero if the receive context is complete and this is the final invocation used to deliver the completed event or if there was a connection error.    There are scenarios where the data will be set (non-Zero) but the error will be set, indicating that some data was received, before the error was triggerred.
dataSize
The size of the block of data read, it is generally the minimum amount of data requested, but can be less when the connection terminates and the remote end does not send as much data as expected.
context

Context indicating the state of the connection and the metadata for the data being received.

For TCP connections, the context is kept for the duration of the connection and the the NWContentContext.IsFinal property will be set to true, indicating that the other end closed the connection.

For UDP connections, the context represents the information about the packet that was received.

isComplete
This flag is set to true when the connection has completed and there is no more data to read.
error
This value will be null if there are no errors, or will contain the error that was raised during the receive operation.

Remarks

Requirements

Namespace: Network
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0

The members of Network.NWConnectionReceiveCompletion are listed below.

See Also: Delegate