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("FULLNAME");
19 if (p != null) cf.setFullname(p);
21 p = getParameter("HOSTNAME");
22 if (p != null) cf.setHostname(p);
24 p = getParameter("PORT");
25 if (p != null) cf.setPort(p);
27 p = getParameter("CHANNEL");
28 if (p != null) cf.setChannel(p);
30 Beep = getAudioClip(getCodeBase(), "ding.au");
37 public void doconnect() {
39 s = new Socket(cf.getHostname(), Integer.parseInt(cf.getPort()));
40 out = new PrintStream(s.getOutputStream());
41 in = new DataInputStream(s.getInputStream());
42 cf.initPrintStream(out);
44 listener = new StreamListener(cf, in);
46 out.println(cf.getCall());
47 out.println(cf.getFullname());
49 catch (IOException e) {
50 InfoDialog id = new InfoDialog(cf, "Error", e.toString());
56 public void dodisconnect() {
60 catch (IOException e) {
61 InfoDialog id = new InfoDialog(cf, "Error", e.toString());
71 private Socket s = null;
72 private PrintStream out;
73 private DataInputStream in;
74 private StreamListener listener;
76 private AudioClip Beep;
81 class StreamListener extends Thread {
85 public StreamListener(spiderframe cf, DataInputStream in) {
98 // schrieb nur jede 2te zeile , deswegen //
99 // line = in.readLine();
105 if (line == null) break;
110 catch (IOException e) {
111 cf.setText(e.toString());
115 finally { cf.setText("Connection closed by server."); }