From: TJ Date: Mon, 4 May 2015 15:21:35 +0000 (+0100) Subject: Network: add PORTS_EPHEMERAL constant X-Git-Url: https://iam.tj/gitweb/gitweb.cgi?p=WeStealzYourDataz.git;a=commitdiff_plain;h=67b1ef58cf4cfa003ade062c4c4fea9bd027d0e2 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. --- 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.