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 Beep = getAudioClip(getCodeBase(), "ding.au");
40 public void doconnect() {
42 s = new Socket(cf.getHostname(), Integer.parseInt(cf.getPort()));
43 out = new PrintStream(s.getOutputStream());
44 in = new DataInputStream(s.getInputStream());
45 cf.initPrintStream(out);
47 listener = new StreamListener(cf, in);
49 out.println(cf.getCall());
51 if(cf.getPassword().length() > 0) {
52 out.println(cf.getPassword());
55 // out.println(cf.getFullname());
57 catch (IOException e) {
58 InfoDialog id = new InfoDialog(cf, "Error", e.toString());
64 public void dodisconnect() {
68 catch (IOException e) {
69 InfoDialog id = new InfoDialog(cf, "Error", e.toString());
79 private Socket s = null;
80 private PrintStream out;
81 private DataInputStream in;
82 private StreamListener listener;
84 private AudioClip Beep;
89 class StreamListener extends Thread {
93 public StreamListener(spiderframe cf, DataInputStream in) {
104 line = in.readLine();
106 // schrieb nur jede 2te zeile , deswegen //
107 // line = in.readLine();
113 if (line == null) break;
118 catch (IOException e) {
119 cf.setText(e.toString());
123 finally { cf.setText("Connection closed by server."); }