Commit 66d170d8 authored by akwizgran's avatar akwizgran

Don't accept a keepalive interval of 0 seconds.

parent 3436bd97
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment