public RequestReceiver(int port) throws IOException { UDPserverSocket = new DatagramSocket(port); System.out.println( "UDP Request Receiver Running on " + UDPserverSocket.getInetAddress() + ":" + UDPserverSocket.getLocalPort()); UDPserverSocket.setSoTimeout(0); }
static String printSocket(DatagramSocket socket) { return "[Socket: localPort=" + socket.getLocalPort() + ", remoteAddr=" + socket.getInetAddress() + ", localAddr=" + socket.getLocalAddress() + "]"; }