public void setOutbound(Publisher<? extends WebSocketFrame> outbound) {
        requireNonNull(outbound, "outbound");
        if (outboundFuture.isDone()) {
            if (outbound instanceof StreamMessage) {
                ((StreamMessage<?>) outbound).abort();
            }
            throw new IllegalStateException("outbound() or setOutbound() has been already called.");
        }
        final StreamMessage<? extends WebSocketFrame> streamMessage;
        if (outbound instanceof StreamMessage) {
            streamMessage = (StreamMessage<? extends WebSocketFrame>) outbound;
        } else {
            streamMessage = new PublisherBasedStreamMessage<>(outbound);
        }

        if (!outboundFuture.complete(
                streamMessage.map(webSocketFrame -> HttpData.wrap(encoder.encode(ctx, webSocketFrame))))) {
            streamMessage.abort();
            throw new IllegalStateException("outbound() or setOutbound() has been already called.");
        }
    }
Sets the {@link WebSocket} that is used to send WebSocket frames to the server.

@throws IllegalStateException if this method or {@link #outbound()} has been called already.
core/src/main/java/com/linecorp/armeria/client/websocket/WebSocketSession.java