}
}
owner.tcpHandler.setMessageHandler(owner);
MulticastUDPHandler muh = null;
try {
boolean quit = false;
// byte key[] = new byte[1];
while(!quit)
{
ChatMessage msgT = new ChatMessage();
byte msgBuf[] = msgT.build();
System.out.println("Press to close...");
int i = System.in.read();
switch(i)
{
case 's':
case 'S':
for(int d=0;d<1;d++){
for(int n=0;n<50;n++){
owner.tcpHandler.sendData(msgBuf, msgBuf.length);
}
try {
Thread.sleep(1000);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
}
break;
case 'm':
case 'M':
muh = new MulticastUDPHandler();
muh.setMessageHandler(owner);
muh.start("228.5.6.7", 4322);
break;
case 'n':
case 'N':
muh.sendData(msgBuf, msgBuf.length);
break;
case 'q':
case 'Q':
quit = true;
break;