public void connect(String user, String pass) { if (!connected) { try { socket = new Socket(domain, 4446); out = new PrintWriter(socket.getOutputStream(), true); // in = new BufferedReader(new InputStreamReader(socket.getInputStream())); in = new ObjectInputStream(socket.getInputStream()); } catch (java.net.UnknownHostException e) { System.err.println("Don't know about host"); return; } catch (IOException e) { System.err.println("Couldn't get I/O for the connection to"); return; } this.connected = true; rec = new Receiver(in); rec.start(); } }
/** Start Substrate running. */ public void start() { sndr.start(); rcvr.start(); }