org.springframework.web.socket

Class PingMessage

  • All Implemented Interfaces:
    WebSocketMessage<java.nio.ByteBuffer>


    public final class PingMessage
    extends AbstractWebSocketMessage<java.nio.ByteBuffer>
    A WebSocket ping message.
    Since:
    4.0
    Author:
    Rossen Stoyanchev
    • Constructor Detail

      • PingMessage

        public PingMessage()
        Create a new ping message with an empty payload.
      • PingMessage

        public PingMessage(java.nio.ByteBuffer payload)
        Create a new ping message with the given ByteBuffer payload.
        Parameters:
        payload - the non-null payload
    • Method Detail

      • getPayloadLength

        public int getPayloadLength()
        Description copied from interface: WebSocketMessage
        Return the number of bytes contained in the message.