Uses of Interface
java.net.http.WebSocket
-
Packages that use WebSocket 软件包 描述 java.net.http HTTP客户端和WebSocket API -
-
Uses of WebSocket in java.net.http
Methods in java.net.http that return types with arguments of type WebSocket 变量和类型 方法 描述 CompletableFuture<WebSocket>
WebSocket.Builder. buildAsync(URI uri, WebSocket.Listener listener)
建立一个WebSocket
连接到给定的URI
,并与给定的相关联Listener
。CompletableFuture<WebSocket>
WebSocket. sendBinary(ByteBuffer data, boolean last)
使用给定缓冲区中的字节发送二进制数据。CompletableFuture<WebSocket>
WebSocket. sendClose(int statusCode, String reason)
通过发送具有给定状态代码和原因的Close消息来启动此WebSocket输出的有序关闭。CompletableFuture<WebSocket>
WebSocket. sendPing(ByteBuffer message)
从给定缓冲区发送包含字节的Ping消息。CompletableFuture<WebSocket>
WebSocket. sendPong(ByteBuffer message)
从给定缓冲区发送包含字节的Pong消息。CompletableFuture<WebSocket>
WebSocket. sendText(CharSequence data, boolean last)
使用给定字符序列中的字符发送文本数据。Methods in java.net.http with parameters of type WebSocket 变量和类型 方法 描述 default CompletionStage<?>
WebSocket.Listener. onBinary(WebSocket webSocket, ByteBuffer data, boolean last)
已收到二进制数据。default CompletionStage<?>
WebSocket.Listener. onClose(WebSocket webSocket, int statusCode, String reason)
收到一条Close消息,指示WebSocket的输入已关闭。default void
WebSocket.Listener. onError(WebSocket webSocket, Throwable error)
发生了错误。default void
WebSocket.Listener. onOpen(WebSocket webSocket)
已连接WebSocket
。default CompletionStage<?>
WebSocket.Listener. onPing(WebSocket webSocket, ByteBuffer message)
已收到Ping消息。default CompletionStage<?>
WebSocket.Listener. onPong(WebSocket webSocket, ByteBuffer message)
已收到Pong消息。default CompletionStage<?>
WebSocket.Listener. onText(WebSocket webSocket, CharSequence data, boolean last)
已收到文本数据。
-