Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
*/

import com.github.kklisura.cdt.services.exceptions.WebSocketServiceException;

import java.io.Closeable;
import java.net.URI;
import java.util.function.Consumer;

Expand All @@ -29,7 +31,7 @@
*
* @author Kenan Klisura
*/
public interface WebSocketService {
public interface WebSocketService extends Closeable {
/**
* Connects to a specified URI.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ public void onMessage(String message) {
@Override
public void close() {
try {
session.close();
session = null;
if (session != null) {
session.close();
session = null;
}
} catch (IOException e) {
LOGGER.error("Failed closing ws session on {}...", session.getRequestURI(), e);
}
Expand Down