Class MessageSocket

  • All Implemented Interfaces:
    ReplicatorConnection, AutoCloseable

    public class MessageSocket
    extends C4Socket
    implements ReplicatorConnection
    This class should be re-implemented using the paradigms described in C4Socket and AbstractCBLWebSocket. It should be re-architected to use a single-threaded executor. It might need to be a state machine.
    • Method Detail

      • receive

        public final void receive​(@NonNull
                                  Message message)
        Description copied from interface: ReplicatorConnection
        Tells the replicator to consume the data received from the other peer.
        Specified by:
        receive in interface ReplicatorConnection
        Parameters:
        message - the message
      • close

        public final void close​(@Nullable
                                MessagingError error)
        Description copied from interface: ReplicatorConnection
        Tells the replicator to close the current replicator connection. In return, the replicator will call the MessageEndpointConnection's close(error, completion) to acknowledge the closed connection.
        Specified by:
        close in interface ReplicatorConnection
        Parameters:
        error - the error if any