aboutsummaryrefslogtreecommitdiff
path: root/tests/Bug.java
blob: 398bbee413d1488913bd6b2766c79e84a69c0b33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import fr.dgac.ivy.* ;

class Bug implements IvyApplicationListener {

    private Ivy bus;

    Bug() {
      bus = new Ivy("Bug","Hello le monde",this);
      try {
	bus.start(null);
      } catch (IvyException ie) {
	System.err.println("can't run the Ivy bus" + ie.getMessage());
      }
    }

    public void disconnect(IvyClient client) { }

    public void directMessage(IvyClient client,int id,String msgarg) {}

    public void connect(IvyClient client) {
      System.out.println("sending messages");
      try {
	bus.sendMsg("coucou");
	bus.sendMsg("titi");
	bus.sendMsg("tata");
	bus.sendMsg("toto");
      } catch (IvyException ie) { }
      System.out.println("done");
    }

    public void die(IvyClient client,int id,String msg) {
      System.out.println("argh. cya "+msg);
    }

    public static void main(String args[]) {
      new Bug();
    }
}