iOS Guides | Samples

MonoTouch.NetworkExtension.NWTcpConnection Class

Connects to and sends and receives data from TCP network connections.

See Also: NWTcpConnection

Syntax

[MonoTouch.Foundation.Register("NWTCPConnection", true)]
[MonoTouch.ObjCRuntime.Introduced(MonoTouch.ObjCRuntime.PlatformName.iOS, 9, 0, MonoTouch.ObjCRuntime.PlatformArchitecture.None, null)]
[MonoTouch.ObjCRuntime.Introduced(MonoTouch.ObjCRuntime.PlatformName.MacOSX, 10, 11, MonoTouch.ObjCRuntime.PlatformArchitecture.Arch64, null)]
public class NWTcpConnection : NSObject

Related content

Requirements

Namespace: MonoTouch.NetworkExtension
Assembly: monotouch (in monotouch.dll)
Assembly Versions: 0.0.0.0

The members of MonoTouch.NetworkExtension.NWTcpConnection are listed below.

See Also: NSObject

Public Constructors

Default constructor, initializes a new instance of this class.
A constructor that initializes the object from the data stored in the unarchiver object.
Constructor to call on derived classes to skip initialization and merely allocate the object.
Creates a new connection from the provided connection.
A constructor used when creating managed representations of unmanaged objects; Called by the runtime.

Public Properties

[read-only]
override
ClassHandleIntPtr. The handle for this class.
[read-only]
ConnectedPathNWPath. Gets the path through which the connection was made.
[read-only]
EndpointNWEndpoint. Gets the remote endpoint of the connection.
[read-only]
ErrorNSError. Gets the error that caused the connection to fail, if it failed.
[read-only]
HasBetterPathBoolean. Gets a Boolean value that tells whether new connections to the remote endpoint have a better path available to them..
[read-only]
LocalAddressNWEndpoint. Gets the address from which the connectio was made.
[read-only]
RemoteAddressNWEndpoint. Gets the remote endpoint to which the connection was made.
[read-only]
StateNWTcpConnectionState. Gets the state of the connection.
[read-only]
TxtRecordNSData.
[read-only]
ViableBoolean. Gets the TXT record of the connection.

Public Methods

Cancel()
Cancels the connection.
ReadLength(UInt32, Action<MonoTouch.Foundation.NSData, MonoTouch.Foundation.NSError>)
Reads length bytes from the connection, and runs a completion handler when the operation is complete.
ReadLengthAsync(UInt32) : System.Threading.Tasks.Task<MonoTouch.Foundation.NSData>
Reads bytes from the connection, and runs a completion handler when the operation is complete.
ReadMinimumLength(UInt32, UInt32, Action<MonoTouch.Foundation.NSData, MonoTouch.Foundation.NSError>)
Reads at least minimum and at most maximum bytes from the connection, and runs a completion handler when the operation is complete.
ReadMinimumLengthAsync(UInt32, UInt32) : System.Threading.Tasks.Task<MonoTouch.Foundation.NSData>
Reads at least and at most bytes from the connection, and runs a completion handler when the operation is complete.
Write(NSData, Action<MonoTouch.Foundation.NSError>)
Writes the provided data to the connection and runs a completion handler when the operation completes.
WriteAsync(NSData) : Task
Writes the provided to the connection and runs a completion handler when the operation completes.
WriteClose()
Closes the connection for write operations.