XConnection interface
and is uses by the WebsocketConnector.
This class is not part of the provided api.
com.sun.star.lib.connections.socket.socketAcceptor , com.sun.star.lib.connections.socket.socketConnector , com.sun.star.connection.XConnection
| Modifier and Type | Field and Description |
|---|---|
| protected String | |
| protected InputStream | |
| protected OutputStream | |
| protected ArrayList | |
| protected ByteArrayOutputStream | |
| public static final boolean | DEBUG
When set to true, enables various debugging output. |
| pack-priv static final byte[] |
| Access | Constructor and Description |
|---|---|
| public | WebsocketConnection(String
the description of the connection. description, ConnectionDescriptor the websocket ConnectionDescriptor containing information such as the websocket URL desc)Constructs a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | close()
Overrides org. Implements org. Closes the connection. |
| public void | |
| public String | |
| private void | |
| private void | |
| private void | |
| public void | onClose(int code, String reason, boolean remote)
Implements abstract org. Called after the websocket connection has been closed. |
| public void | onError(Exception ex)
Implements abstract org. Called when errors occurs. |
| public void | onMessage(String message)
Implements abstract org. Callback for string messages received from the remote host |
| public void | onMessage(ByteBuffer message)
Overrides org. Callback for binary messages received from the remote host |
| public void | onOpen(ServerHandshake handshakedata)
Implements abstract org. Called after an opening handshake has been performed and the given websocket is ready to be written on. |
| public int | Returns: the number of bytes read.the outparameter, where the bytes have to be placed. bytes, int the number of bytes to read. nBytesToRead)Read the required number of bytes. |
| public void | |
| public void |
| _description | back to summary |
|---|---|
| protected String _description | |
| _inputStream | back to summary |
|---|---|
| protected InputStream _inputStream | |
| _inputStreamWriter | back to summary |
|---|---|
| protected OutputStream _inputStreamWriter | |
| _listeners | back to summary |
|---|---|
| protected ArrayList<com. | |
| _outputStream | back to summary |
|---|---|
| protected ByteArrayOutputStream _outputStream | |
| DEBUG | back to summary |
|---|---|
| public static final boolean DEBUG When set to true, enables various debugging output. | |
| outgoingPrefix | back to summary |
|---|---|
| pack-priv static final byte[] outgoingPrefix | |
| WebsocketConnection | back to summary |
|---|---|
| public WebsocketConnection(String description, ConnectionDescriptor desc) throws IOException, URISyntaxException, InterruptedException Constructs a new
| |
| addStreamListener | back to summary |
|---|---|
| public void addStreamListener(com. | |
| close | back to summary |
|---|---|
| public void close() throws com.sun.star.uno.RuntimeException Overrides org. Implements org. Closes the connection. | |
| flush | back to summary |
|---|---|
| public void flush() throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException Sends the data over the websocket to whatever is on the other side. **NOTE**: unlike with genuine streams, without flushing the data is never sent | |
| getDescription | back to summary |
|---|---|
| public String getDescription() throws com.sun.star.uno.RuntimeException Gives a description of the connection.
| |
| notifyListeners_close | back to summary |
|---|---|
| private void notifyListeners_close() | |
| notifyListeners_error | back to summary |
|---|---|
| private void notifyListeners_error(com. | |
| notifyListeners_open | back to summary |
|---|---|
| private void notifyListeners_open() | |
| onClose | back to summary |
|---|---|
| public void onClose(int code, String reason, boolean remote) Implements abstract org. Doc from org. Called after the websocket connection has been closed.
| |
| onError | back to summary |
|---|---|
| public void onError(Exception ex) Implements abstract org. Doc from org. Called when errors occurs. If an error causes the websocket connection to fail
| |
| onMessage | back to summary |
|---|---|
| public void onMessage(String message) Implements abstract org. Doc from org. Callback for string messages received from the remote host
| |
| onMessage | back to summary |
|---|---|
| public void onMessage(ByteBuffer message) Overrides org. Doc from org. Callback for binary messages received from the remote host
| |
| onOpen | back to summary |
|---|---|
| public void onOpen(ServerHandshake handshakedata) Implements abstract org. Doc from org. Called after an opening handshake has been performed and the given websocket is ready to be written on.
| |
| read | back to summary |
|---|---|
| public int read(byte[][] bytes, int nBytesToRead) throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException Read the required number of bytes.
| |
| removeStreamListener | back to summary |
|---|---|
| public void removeStreamListener(com. | |
| write | back to summary |
|---|---|
| public void write(byte[] aData) throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException Write bytes.
| |