FileDocCategorySizeDatePackage
UDPDaytimeServer.javaAPI DocExample600Thu Apr 03 15:25:42 BST 1997None

UDPDaytimeServer

public class UDPDaytimeServer extends UDPServer

Fields Summary
protected static int
defaultPort
Constructors Summary
Methods Summary
public static voidrespond(java.net.DatagramSocket ds, java.net.DatagramPacket dp)

 
         

    DatagramPacket outgoing;
    
    Date now = new Date();
    String s = now.toString();
    byte[] data = new byte[s.length()];
    s.getBytes(0, s.length(), data, 0);
    try {
      outgoing = new DatagramPacket(data, data.length, dp.getAddress(), dp.getPort());
      ds.send(outgoing);
    }
    catch (IOException e) {
      System.err.println(e);
    }