Operating systems generally limit binding to ports below 1024 to
super users. However, 1024 is fine for normal users. This change
augments the precondition check to allow for port 1024 if it is
specified.
Change-Id: I876ff1694371e0c71b94806a6a1b7dbf3b27950f
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
*/
public static WebSocketServer createInstance(int port) {
Preconditions.checkState(instance == null, "createInstance() has already been called");
- Preconditions.checkArgument(port > 1024, "Privileged port (below 1024) is not allowed");
+ Preconditions.checkArgument(port >= 1024, "Privileged port (below 1024) is not allowed");
instance = new WebSocketServer(port);
return instance;