FileDocCategorySizeDatePackage
UDPServer.javaAPI DocExample507Sun Jan 04 21:04:02 GMT 1998dcj.examples

UDPServer

public class UDPServer extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] argv)

      try {
        DatagramSocket ds = new DatagramSocket(5000);
        byte[] data = new byte[1024];
        DatagramPacket p = new DatagramPacket(data, 1024);
        ds.receive(p);
        System.out.println("Server got data: " + p.getData());
      }
      catch (Exception e) {
        System.out.println("Server got exception: ");
        e.printStackTrace();
      }