Class MessageEndpointListener
A listener class that accepts incoming replicators that use the MessageEndpoint class as their endpoint. Discovery and initial connection must be handled by the application, but once that is finished the connection can then be passed to the listener via the Accept(IMessageEndpointConnection) method.
Inheritance
Inherited Members
Namespace: Couchbase.Lite.P2P
Assembly: Couchbase.Lite.dll
Syntax
public sealed class MessageEndpointListener : IStoppable
Remarks
NOTE: This is an enterprise edition feature
Constructors
| Improve this Doc View SourceMessageEndpointListener(MessageEndpointListenerConfiguration)
Constructor
Declaration
public MessageEndpointListener(MessageEndpointListenerConfiguration config)
Parameters
Type | Name | Description |
---|---|---|
MessageEndpointListenerConfiguration | config | The configuration object with the details of the object to be created |
Remarks
NOTE: This is an enterprise edition feature
Properties
| Improve this Doc View SourceConnections
Gets a list of connections that this listener is currently serving
Declaration
public IReadOnlyCollection<IMessageEndpointConnection> Connections { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyCollection<IMessageEndpointConnection> |
Remarks
NOTE: This is an enterprise edition feature
Methods
| Improve this Doc View SourceAccept(IMessageEndpointConnection)
Accepts an incoming connection to the listener, and starts the server side replication process
Declaration
public void Accept(IMessageEndpointConnection connection)
Parameters
Type | Name | Description |
---|---|---|
IMessageEndpointConnection | connection | The incoming connection |
Remarks
NOTE: This is an enterprise edition feature
AddChangeListener(EventHandler<MessageEndpointListenerChangedEventArgs>)
Adds a change listener that tracks changes in the listener for any active replication
Declaration
public ListenerToken AddChangeListener(EventHandler<MessageEndpointListenerChangedEventArgs> handler)
Parameters
Type | Name | Description |
---|---|---|
System.EventHandler<MessageEndpointListenerChangedEventArgs> | handler | The callback to handle the change |
Returns
Type | Description |
---|---|
ListenerToken | A token that can be used to remove the change listener later |
Remarks
NOTE: This is an enterprise edition feature
AddChangeListener(TaskScheduler, EventHandler<MessageEndpointListenerChangedEventArgs>)
Adds a change listener that tracks changes in the listener for any active replication
Declaration
public ListenerToken AddChangeListener(TaskScheduler scheduler, EventHandler<MessageEndpointListenerChangedEventArgs> handler)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.Tasks.TaskScheduler | scheduler | The task scheduler to use when firing the callback |
System.EventHandler<MessageEndpointListenerChangedEventArgs> | handler | The callback to handle the change |
Returns
Type | Description |
---|---|
ListenerToken | A token that can be used to remove the change listener later |
Remarks
NOTE: This is an enterprise edition feature
Close(IMessageEndpointConnection)
Stops the replicator and closes the given connection
Declaration
public void Close(IMessageEndpointConnection connection)
Parameters
Type | Name | Description |
---|---|---|
IMessageEndpointConnection | connection | The connection for which to stop the replicator and close |
Remarks
NOTE: This is an enterprise edition feature
CloseAll()
Stops all replicators and closes all connections
Declaration
public void CloseAll()
Remarks
NOTE: This is an enterprise edition feature
RemoveChangeListener(ListenerToken)
Removes a change listener that was previously added by AddChangeListener(EventHandler<MessageEndpointListenerChangedEventArgs>)
Declaration
public void RemoveChangeListener(ListenerToken token)
Parameters
Type | Name | Description |
---|---|---|
ListenerToken | token |
Remarks
NOTE: This is an enterprise edition feature
Stop()
Declaration
public void Stop()