Package io.fabric8.mockwebserver.http
Interface WebSocket
-
- All Known Implementing Classes:
VertxMockWebSocket
public interface WebSocket
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description booleanclose(int code, String reason)Attempts to initiate a graceful shutdown of this web socket.RecordedRequestrequest()Returns the original request that initiated this web socket.booleansend(byte[] bytes)Attempts to enqueuebytesto be sent as a the data of a binary (type0x2) message.default booleansend(ByteString bytes)Deprecated.usesend(byte[])orsend(String)instead.booleansend(String text)Attempts to enqueuetextto be UTF-8 encoded and sent as the data of a text (type0x1) message.
-
-
-
Method Detail
-
request
RecordedRequest request()
Returns the original request that initiated this web socket.
-
send
boolean send(String text)
Attempts to enqueuetextto be UTF-8 encoded and sent as the data of a text (type0x1) message.
-
send
boolean send(byte[] bytes)
Attempts to enqueuebytesto be sent as a the data of a binary (type0x2) message.
-
send
@Deprecated default boolean send(ByteString bytes)
Deprecated.usesend(byte[])orsend(String)instead.Compatibility layer for OkHttp.
-
close
boolean close(int code, String reason)Attempts to initiate a graceful shutdown of this web socket.No more messages can be sent.
- Parameters:
code- the status code.reason- reason of closure.
-
-