// Sender class used to test our handshake classe handshake2. // // SGM 28/10/99 class sender extends Thread { private int pause = 50 ; // Milliseconds between sending messages. private String id ; private handshake2 hand ; public sender(String s, handshake2 h) { id = s ; hand = h ; } public void run() { int i = 1 ; do { try{ sleep( (int) Math.round( pause * Math.random() ) ) ; } catch(InterruptedException e) { } ; hand.send( new Integer(i) ) ; System.out.println( id + " has sent " + i++ ) ; } while (true) ; } }