接口 MessageSender<M extends Message>

    • 方法概要

      所有方法 实例方法 默认方法 
      修饰符和类型 方法 说明
      default void send​(byte[] message, int messageLen, byte messageSequence)
      Synchronously send the message to server.
      default void send​(M message)
      Synchronously send the message to server.
      default CompletableFuture<?> send​(M message, CompletableFuture<?> future, Runnable callback)
      Asynchronously write a message with a notification being delivered to callback upon completion of write of entire message.
      default void setMaxAllowedPacket​(int maxAllowedPacket)
      Set max allowed packet size.
      default MessageSender<M> undecorate()
      Return the previous PacketSender instance from the decorators chain or the current PacketSender if it is the first entry in a chain.
      default MessageSender<M> undecorateAll()
      Return a PacketSender instance free of decorators.
    • 方法详细资料

      • send

        default void send​(byte[] message,
                          int messageLen,
                          byte messageSequence)
                   throws IOException
        Synchronously send the message to server.
        参数:
        message - byte array containing a message
        messageLen - length of the message
        messageSequence - message sequence index (used in a native protocol)
        抛出:
        IOException - if an error occurs
      • send

        default void send​(M message)
        Synchronously send the message to server.
        参数:
        message - Message instance
      • send

        default CompletableFuture<?> send​(M message,
                                          CompletableFuture<?> future,
                                          Runnable callback)
        Asynchronously write a message with a notification being delivered to callback upon completion of write of entire message.
        参数:
        message - message extending Message
        future - a Future returning operation result
        callback - a callback to receive notification of when the message is completely written
        返回:
        result
      • setMaxAllowedPacket

        default void setMaxAllowedPacket​(int maxAllowedPacket)
        Set max allowed packet size.
        参数:
        maxAllowedPacket - max allowed packet size
      • undecorateAll

        default MessageSender<M> undecorateAll()
        Return a PacketSender instance free of decorators.
        返回:
        MessageSender instance
      • undecorate

        default MessageSender<M> undecorate()
        Return the previous PacketSender instance from the decorators chain or the current PacketSender if it is the first entry in a chain.
        返回:
        MessageSender instance