| 37 | import org.java_websocket.protocols.IProtocol; |
| 38 | |
| 39 | public interface WebSocket { |
| 40 | |
| 41 | /** |
| 42 | * sends the closing handshake. may be send in response to an other handshake. |
| 43 | * |
| 44 | * @param code the closing code |
| 45 | * @param message the closing message |
| 46 | */ |
| 47 | void close(int code, String message); |
| 48 | |
| 49 | /** |
| 50 | * sends the closing handshake. may be send in response to an other handshake. |
| 51 | * |
| 52 | * @param code the closing code |
| 53 | */ |
| 54 | void close(int code); |
| 55 | |
| 56 | /** |
| 57 | * Convenience function which behaves like close(CloseFrame.NORMAL) |
| 58 | */ |
| 59 | void close(); |
| 60 | |
| 61 | /** |
| 62 | * This will close the connection immediately without a proper close handshake. The code and the |
| 63 | * message therefore won't be transferred over the wire also they will be forwarded to |
| 64 | * onClose/onWebsocketClose. |
| 65 | * |
| 66 | * @param code the closing code |
| 67 | * @param message the closing message |
| 68 | **/ |
| 69 | void closeConnection(int code, String message); |
| 70 | |
| 71 | /** |
| 72 | * Send Text data to the other end. |
| 73 | * |
| 74 | * @param text the text data to send |
| 75 | * @throws WebsocketNotConnectedException websocket is not yet connected |
| 76 | */ |
| 77 | void send(String text); |
| 78 | |
| 79 | /** |
| 80 | * Send Binary data (plain bytes) to the other end. |
| 81 | * |
| 82 | * @param bytes the binary data to send |
| 83 | * @throws IllegalArgumentException the data is null |
| 84 | * @throws WebsocketNotConnectedException websocket is not yet connected |
| 85 | */ |
| 86 | void send(ByteBuffer bytes); |
| 87 | |
| 88 | /** |
| 89 | * Send Binary data (plain bytes) to the other end. |
| 90 | * |
| 91 | * @param bytes the byte array to send |
| 92 | * @throws IllegalArgumentException the data is null |
| 93 | * @throws WebsocketNotConnectedException websocket is not yet connected |
| 94 | */ |
| 95 | void send(byte[] bytes); |
| 96 |
no outgoing calls
no test coverage detected
searching dependent graphs…