7 public class spiderclient extends Applet {
12 cf = new spiderframe(this);
15 p = getParameter("CALL");
16 if (p != null) cf.setCall(p);
18 p = getParameter("PASSWORD");
19 if (p != null) cf.setPassword(p);
21 p = getParameter("FULLNAME");
22 if (p != null) cf.setFullname(p);
24 p = getParameter("HOSTNAME");
25 if (p != null) cf.setHostname(p);
27 p = getParameter("PORT");
28 if (p != null) cf.setPort(p);
30 p = getParameter("CHANNEL");
31 if (p != null) cf.setChannel(p);
33 p = getParameter("NODECALL");
34 if (p != null) cf.setNodecall(p);
36 Beep = getAudioClip(getCodeBase(), "ding.au");
43 public void doconnect() {
45 s = new Socket(cf.getHostname(), Integer.parseInt(cf.getPort()));
46 out = new PrintStream(s.getOutputStream());
47 in = new DataInputStream(s.getInputStream());
48 cf.initPrintStream(out);
50 listener = new StreamListener(cf, in);
52 out.println(cf.getCall());
54 if(cf.getPassword().length() > 0) {
55 out.println(cf.getPassword());
57 // out.println(cf.getFullname());
59 catch (IOException e) {
60 InfoDialog id = new InfoDialog(cf, "Error", e.toString());
66 public void dodisconnect() {
70 catch (IOException e) {
71 InfoDialog id = new InfoDialog(cf, "Error", e.toString());
81 private Socket s = null;
82 private PrintStream out;
83 private DataInputStream in;
84 private StreamListener listener;
86 private AudioClip Beep;
91 class StreamListener extends Thread {
95 public StreamListener(spiderframe cf, DataInputStream in) {
106 line = in.readLine();
108 // schrieb nur jede 2te zeile , deswegen //
109 // line = in.readLine();
111 if (line == null) break;
116 catch (IOException e) {
117 cf.setText(e.toString());
120 finally { cf.setText("Connection closed by server."); }