Пример #1
0
 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();
   }
 }
Пример #2
0
 /** Start Substrate running. */
 public void start() {
   sndr.start();
   rcvr.start();
 }