From 67b1ef58cf4cfa003ade062c4c4fea9bd027d0e2 Mon Sep 17 00:00:00 2001 From: TJ Date: Mon, 4 May 2015 16:21:35 +0100 Subject: [PATCH] Network: add PORTS_EPHEMERAL constant This, rather than a plain 0, adds semmantic sugar to make it obvious when constructing a socket and expecting to be given an ephemeral port by the operating system. --- src/uk/ac/ntu/n0521366/wsyd/libs/net/Network.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/uk/ac/ntu/n0521366/wsyd/libs/net/Network.java b/src/uk/ac/ntu/n0521366/wsyd/libs/net/Network.java index 6cc4e12..0f02897 100644 --- a/src/uk/ac/ntu/n0521366/wsyd/libs/net/Network.java +++ b/src/uk/ac/ntu/n0521366/wsyd/libs/net/Network.java @@ -37,6 +37,7 @@ public class Network { public static final int PORTS_MULTICAST_DISCOVERY = 50003; public static final int PORTS_CLIENT_CONTROL_FIRST = 50010; public static final int PORTS_CLIENT_CHAT_FIRST = 51000; + public static final int PORTS_EPHEMERAL = 0; /** * Special IPv4 'wildcard' address asking java.net.ServerSocket#bind to bind to all interfaces. -- 2.17.1