Skip to content
Snippets Groups Projects
Commit 66d170d8 authored by akwizgran's avatar akwizgran
Browse files

Don't accept a keepalive interval of 0 seconds.

parent 3436bd97
No related branches found
No related tags found
No related merge requests found
......@@ -58,7 +58,7 @@ public class SnoozeServer implements Runnable {
socket.setSoTimeout(SOCKET_TIMEOUT_MS);
DataInputStream in = new DataInputStream(socket.getInputStream());
OutputStream out = socket.getOutputStream();
int keepaliveIntervalSecs = in.readUnsignedShort();
int keepaliveIntervalSecs = Math.max(1, in.readUnsignedShort());
while (!socket.isClosed()) {
System.out.println("Writing: " + socket.getRemoteSocketAddress());
out.write(0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment