Interface HybridConnectionChannel

All Superinterfaces:
AutoCloseable, Channel, Closeable
All Known Implementing Classes:
WebSocketChannel

public interface HybridConnectionChannel extends Channel
  • Method Details

    • getTrackingContext

      TrackingContext getTrackingContext()
    • closeAsync

      CompletableFuture<Void> closeAsync()
      Closes the connection with the remote websocket
      Returns:
      Returns a CompletableFuture which completes when the connection is completely closed.
    • closeAsync

      CompletableFuture<Void> closeAsync(javax.websocket.CloseReason reason)
      Closes the connection with the remote websocket with a given CloseReason
      Parameters:
      reason - The CloseReason to be given for this operation. For details please see javax.websocket.CloseReason.
      Returns:
      Returns a CompletableFuture which completes when the connection is completely closed.
    • readAsync

      Receives byte messages from the remote sender asynchronously.
      Returns:
      Returns a CompletableFuture of the bytes which completes when websocket receives the entire message.
    • readAsync

      CompletableFuture<ByteBuffer> readAsync(Duration timeout)
      Receives byte messages from the remote sender asynchronously within a given timeout.
      Parameters:
      timeout - The timeout duration for this operation.
      Returns:
      Returns a CompletableFuture of the bytes which completes when websocket receives the entire message.
    • writeAsync

      CompletableFuture<Void> writeAsync(ByteBuffer data)
      Sends the data to the remote endpoint as binary.
      Parameters:
      data - Message to be sent.
      Returns:
      A CompletableFuture which completes when websocket finishes sending the bytes.
    • writeAsync

      CompletableFuture<Void> writeAsync(ByteBuffer data, Duration timeout)
      Sends the data to the remote endpoint within a timeout as binary.
      Parameters:
      data - Message to be sent.
      timeout - The timeout to connect to send the data within. May be null to indicate no timeout limit.
      Returns:
      A CompletableFuture which completes when websocket finishes sending the bytes.