CBLMessageEndpointListener

@interface CBLMessageEndpointListener : NSObject

ENTERPRISE EDITION ONLY.

The listener for incoming message endpoint connections.

  • The active connections.

    Declaration

    Objective-C

    @property (readonly) NSArray<id<CBLMessageEndpointConnection>> *_Nonnull connections;
  • Initializes the CBLMessageEndpointListener object with the given configuration.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithConfig:
        (nonnull CBLMessageEndpointListenerConfiguration *)config;

    Parameters

    config

    The configuration object.

    Return Value

    The CBLMessageEndpointListener object.

  • Accepts the incoming message endpoint connection.

    Declaration

    Objective-C

    - (void)accept:(nonnull id<CBLMessageEndpointConnection>)connection;

    Parameters

    connection

    The CBLMessageEndpointConnection object.

  • Closes the given message endpoint connection.

    Declaration

    Objective-C

    - (void)close:(nonnull id<CBLMessageEndpointConnection>)connection;

    Parameters

    connection

    The CBLMessageEndpointConnection object

  • Closes all active connections.

    Declaration

    Objective-C

    - (void)closeAll;

Change Listeners

  • Adds a change listener. Changes will be posted on the main queue.

    Declaration

    Objective-C

    - (nonnull id<CBLListenerToken>)addChangeListener:
        (nonnull void (^)(CBLMessageEndpointListenerChange *_Nonnull))listener;

    Parameters

    listener

    The listener to post the changes.

    Return Value

    An opaque listener token object for removing the listener.

  • Adds a change listener with the dispatch queue on which changes will be posted. If the dispatch queue is not specified, the changes will be posted on the main queue.

    Declaration

    Objective-C

    - (nonnull id<CBLListenerToken>)
        addChangeListenerWithQueue:(nullable dispatch_queue_t)queue
                          listener:(nonnull void (^)(
                                       CBLMessageEndpointListenerChange *_Nonnull))
                                       listener;

    Parameters

    queue

    The dispatch queue.

    listener

    The listener to post changes.

    Return Value

    An opaque listener token object for removing the listener.

  • Removes a change listener with the given listener token.

    Declaration

    Objective-C

    - (void)removeChangeListenerWithToken:(nonnull id<CBLListenerToken>)token;

    Parameters

    token

    The listener token.

  • Unavailable

    Not available

    Declaration

    Objective-C

    - (nonnull instancetype)init;