public interface ServerWebSocket
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the connection.
|
String |
header(String name)
Returns the first handshake request header associated with the given name.
|
Set<String> |
headerNames()
The names of the handshake request headers.
|
List<String> |
headers(String name)
Returns the handshake request headers associated with the given name or empty list
if no header is found.
|
ServerWebSocket |
onbinary(Action<ByteBuffer> action)
Attaches an action for the binary frame.
|
ServerWebSocket |
onclose(Action<Void> action)
Attaches an action for the close event.
|
ServerWebSocket |
onerror(Action<Throwable> action)
Attaches an action to handle error from various things.
|
ServerWebSocket |
ontext(Action<String> action)
Attaches an action for the text frame.
|
ServerWebSocket |
send(ByteBuffer byteBuffer)
Sends a binary frame through the connection.
|
ServerWebSocket |
send(String data)
Sends a text frame through the connection.
|
<T> T |
unwrap(Class<T> clazz)
Returns the provider-specific component.
|
String |
uri()
The URI used to connect.
|
String uri()
Set<String> headerNames()
Set
is case-sensitive.String header(String name)
List<String> headers(String name)
void close()
ServerWebSocket send(String data)
ServerWebSocket send(ByteBuffer byteBuffer)
ServerWebSocket ontext(Action<String> action)
ServerWebSocket onbinary(Action<ByteBuffer> action)
ServerWebSocket onclose(Action<Void> action)
ServerWebSocket onerror(Action<Throwable> action)
<T> T unwrap(Class<T> clazz)
Copyright © 2015–2019. All rights reserved.