FileDocCategorySizeDatePackage
echoOutputThread.javaAPI DocExample600Thu Apr 03 15:25:02 BST 1997None

echoOutputThread

public class echoOutputThread extends Thread

Fields Summary
DatagramSocket
theSocket
protected DatagramPacket
dp
Constructors Summary
public echoOutputThread(DatagramSocket s)

    theSocket = s;
    buffer = new byte[65507];
    dp = new DatagramPacket(buffer, buffer.length);
  
Methods Summary
public voidrun()


    while (true) {
      try {
        theSocket.receive(dp);
        String s = new String(dp.getData(), 0, 0, dp.getLength());
        System.out.println(s);
        Thread.yield();
      }
      catch (IOException e) {
        System.err.println(e);
      } 
     
    }