Connection.connect()

DESCRIPTION

Establish a connection synchronously.

When the function returns, the connection is established and can be used with CoAP requests, streams and tunnels.

DECLARATION

    public func connect() 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