Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 static String printSocket(DatagramSocket socket) {
   return "[Socket: localPort="
       + socket.getLocalPort()
       + ", remoteAddr="
       + socket.getInetAddress()
       + ", localAddr="
       + socket.getLocalAddress()
       + "]";
 }