File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
photon-server/src/main/java/org/photonvision/server Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -69,8 +69,7 @@ private DataSocketHandler() {
69
69
70
70
public void onConnect (WsConnectContext context ) {
71
71
users .add (context );
72
- context .session .setIdleTimeout (
73
- Duration .ofMillis (Long .MAX_VALUE )); // TODO: determine better value
72
+ context .session .setIdleTimeout (Duration .ofMillis (5000 ));
74
73
var remote = (InetSocketAddress ) context .session .getRemoteAddress ();
75
74
var host = remote .getAddress ().toString () + ":" + remote .getPort ();
76
75
logger .info ("New websocket connection from " + host );
Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ private static void start(int port) {
109
109
ws -> {
110
110
ws .onConnect (dsHandler ::onConnect );
111
111
ws .onClose (dsHandler ::onClose );
112
+ ws .onError (e -> logger .error (e .toString (), e .error ()));
112
113
ws .onBinaryMessage (dsHandler ::onBinaryMessage );
113
114
});
114
115
You can’t perform that action at this time.
0 commit comments