java.lang.Object
org.miaixz.bus.http.socket.WebSocketListener
org.miaixz.bus.http.plugin.httpv.CoverCall.Listener
- Enclosing class:
CoverCall
A WebSocket listener that bridges Httpd's WebSocket events to the CoverCall's event system.
-
Constructor Summary
ConstructorsConstructorDescriptionListener(CoverCall.Client client, CoverCall webSocket) Constructs a new listener. -
Method Summary
Modifier and TypeMethodDescriptionvoidInvoked when both peers have indicated that no more messages will be transmitted and the connection has been successfully released.voidInvoked when the remote peer has indicated that no more incoming messages will be transmitted.voidInvoked when a web socket has been closed due to an error reading from or writing to the network.voidInvoked when a text (type0x1) message has been received.voidInvoked when a binary (type0x2) message has been received.voidInvoked when a web socket has been accepted by the remote peer and may begin transmitting messages.
-
Constructor Details
-
Listener
Constructs a new listener.- Parameters:
client- The initiating client.webSocket- The CoverCall wrapper.
-
-
Method Details
-
onOpen
Description copied from class:WebSocketListenerInvoked when a web socket has been accepted by the remote peer and may begin transmitting messages.- Overrides:
onOpenin classWebSocketListener- Parameters:
webSocket- The WebSocket that has been opened.response- The HTTP response from the upgrade request.
-
onMessage
Description copied from class:WebSocketListenerInvoked when a text (type0x1) message has been received.- Overrides:
onMessagein classWebSocketListener- Parameters:
webSocket- The WebSocket that received the message.text- The text content of the message.
-
onMessage
Description copied from class:WebSocketListenerInvoked when a binary (type0x2) message has been received.- Overrides:
onMessagein classWebSocketListener- Parameters:
webSocket- The WebSocket that received the message.bytes- The binary content of the message.
-
onClosing
Description copied from class:WebSocketListenerInvoked when the remote peer has indicated that no more incoming messages will be transmitted.- Overrides:
onClosingin classWebSocketListener- Parameters:
webSocket- The WebSocket that is closing.code- The status code from the remote peer.reason- The reason for the closure, or an empty string.
-
onClosed
Description copied from class:WebSocketListenerInvoked when both peers have indicated that no more messages will be transmitted and the connection has been successfully released. No further calls to this listener will be made.- Overrides:
onClosedin classWebSocketListener- Parameters:
webSocket- The WebSocket that has been closed.code- The status code from the remote peer.reason- The reason for the closure, or an empty string.
-
onFailure
Description copied from class:WebSocketListenerInvoked when a web socket has been closed due to an error reading from or writing to the network. Both outgoing and incoming messages may have been lost. No further calls to this listener will be made.- Overrides:
onFailurein classWebSocketListener- Parameters:
webSocket- The WebSocket that failed.t- The exception that caused the failure.response- The HTTP response from the upgrade request, or null if no response was received.
-