Package io.fabric8.mockwebserver.http
Class WebSocketListener
- java.lang.Object
-
- io.fabric8.mockwebserver.http.WebSocketListener
-
- Direct Known Subclasses:
WebSocketSession
public abstract class WebSocketListener extends Object
-
-
Constructor Summary
Constructors Constructor Description WebSocketListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidonBeforeAccept(WebSocket webSocket, Response response)Invoked before the web socket is accepted and the handshake is completevoidonClosed(WebSocket webSocket, int code, String reason)Invoked when both peers have indicated that no more messages will be transmitted and the connection has been successfully released.voidonClosing(WebSocket webSocket, int code, String reason)Invoked when the remote peer has indicated that no more incoming messages will be transmitted.voidonFailure(WebSocket webSocket, Throwable error, Response response)Invoked when a web socket has been closed due to an error reading from or writing to the network.voidonMessage(WebSocket webSocket, byte[] bytes)voidonMessage(WebSocket webSocket, ByteString bytes)Deprecated.useonMessage(WebSocket, byte[])instead.voidonMessage(WebSocket webSocket, String text)voidonOpen(WebSocket webSocket, Response response)Invoked when a web socket has been accepted by the remote peer and may begin transmitting messages.
-
-
-
Method Detail
-
onBeforeAccept
public void onBeforeAccept(WebSocket webSocket, Response response)
Invoked before the web socket is accepted and the handshake is complete
-
onOpen
public void onOpen(WebSocket webSocket, Response response)
Invoked when a web socket has been accepted by the remote peer and may begin transmitting messages.
-
onMessage
@Deprecated public void onMessage(WebSocket webSocket, ByteString bytes)
Deprecated.useonMessage(WebSocket, byte[])instead.Compatibility layer for OkHttp.
-
onMessage
public void onMessage(WebSocket webSocket, byte[] bytes)
-
onClosing
public void onClosing(WebSocket webSocket, int code, String reason)
Invoked when the remote peer has indicated that no more incoming messages will be transmitted.
-
onClosed
public void onClosed(WebSocket webSocket, int code, String reason)
Invoked 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.
-
-