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
Namespace: Couchbase.Lite.P2P
Assembly: Couchbase.Lite.dll
Syntax
public sealed class MessageEndpointListener : object, 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 |
---|---|
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 |
---|---|---|
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 |
---|---|---|
TaskScheduler | scheduler | The task scheduler to use when firing the callback |
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()
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |