Connection.connectAsync() Overload 1
DESCRIPTION
Establish this connection asynchronously.
The specified AsyncStatusReceiver closure is invoked with an error if an error occurs, see the connect()
function for details about error codes.
DECLARATION
public func connectAsync(closure: @escaping AsyncStatusReceiver)
PARAMETERS
closure:
- Invoked when the connect attempt succeeds or fails.
Overload 2
DESCRIPTION
Establish a connection asynchronously using Swift concurrency..
When the function returns, the connection is established and can be used with CoAP requests, streams and tunnels.
DECLARATION
public func connectAsync() async throws
THROWS ERRORS
UNAUTHORIZED:
- if the authentication options do not match the basestation configuration for this
TOKEN_REJECTED:
- if the basestation could not validate the specified token
STOPPED:
- if the client instance was stopped
NO_CHANNELS:
- if all parameters input were accepted but a connection could not be established. Details about what went wrong are available as the associated localError and remoteError.
NO_CHANNELS.remoteError.NOT_ATTACHED:
- if the target remote device is not attached to the basestation
NO_CHANNELS.remoteError.FORBIDDEN:
- if the basestation request is rejected
NO_CHANNELS.remoteError.NONE:
- if remote relay was not enabled
NO_CHANNELS.localError.NONE:
- if mDNS discovery was not enabled
NO_CHANNELS.localError.NOT_FOUND:
- if no local device was found