public interface WebSocketService
| Modifier and Type | Method and Description |
|---|---|
void |
addMessageHandler(Consumer<String> consumer)
After receiving the message calls the consumer with appropriate message.
|
void |
close()
Closes the service.
|
boolean |
closed()
Checks if connection is closed.
|
void |
connect(URI uri)
Connects to a specified URI.
|
void |
send(String message)
Sends the message using web socket.
|
void connect(URI uri) throws WebSocketServiceException
uri - Server location.WebSocketServiceExceptionvoid send(String message) throws WebSocketServiceException
message - Message to send.WebSocketServiceExceptionvoid addMessageHandler(Consumer<String> consumer) throws WebSocketServiceException
consumer - Consumer to consume the message.WebSocketServiceExceptionvoid close()
boolean closed()
Copyright © 2020. All rights reserved.