Skip to content
Merged
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 @@ -69,8 +69,7 @@ private DataSocketHandler() {

public void onConnect(WsConnectContext context) {
users.add(context);
context.session.setIdleTimeout(
Duration.ofMillis(Long.MAX_VALUE)); // TODO: determine better value
context.session.setIdleTimeout(Duration.ofMillis(5000));
var remote = (InetSocketAddress) context.session.getRemoteAddress();
var host = remote.getAddress().toString() + ":" + remote.getPort();
logger.info("New websocket connection from " + host);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ private static void start(int port) {
ws -> {
ws.onConnect(dsHandler::onConnect);
ws.onClose(dsHandler::onClose);
ws.onError(e -> logger.error(e.toString(), e.error()));
ws.onBinaryMessage(dsHandler::onBinaryMessage);
});

Expand Down
Loading