MessageEndpointListener

public class MessageEndpointListener

The listener for incoming message endpoint connections.

  • Initializes the MessageEndpointListener object with the given configuration.

    Declaration

    Swift

    public init(config: MessageEndpointListenerConfiguration)

    Parameters

    config

    The configuration object.

  • Accepts the incoming message endpoint connection.

    Declaration

    Swift

    public var connections: Array<MessageEndpointConnection>
  • Accepts the incoming message endpoint connection.

    Declaration

    Swift

    public func accept(connection: MessageEndpointConnection)

    Parameters

    connection

    The MessageEndpointConnection object.

  • Closes the given message endpoint connection.

    Declaration

    Swift

    public func close(connection: MessageEndpointConnection)

    Parameters

    connection

    The MessageEndpointConnection object.

  • Close all active connections.

    Declaration

    Swift

    public func closeAll()
  • Adds a change listener. Changes will be posted on the main queue.

    Declaration

    Swift

    @discardableResult public func addChangeListener(
        _ listener: @escaping (MessageEndpointListenerChange) -> Void) -> ListenerToken

    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

    Swift

    @discardableResult public func addChangeListener(withQueue queue: DispatchQueue?,
        _ listener: @escaping (MessageEndpointListenerChange) -> Void) -> ListenerToken

    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

    Swift

    public func removeChangeListener(token: ListenerToken)

    Parameters

    token

    The listener token.