Advertisement
Guest User

Untitled

a guest
Jan 26th, 2015
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.77 KB | None | 0 0
  1. package servidor;
  2.  
  3. import inicio.LuxEmu;
  4. import inicio.Main;
  5.  
  6. import java.io.IOException;
  7. import java.io.PrintWriter;
  8. import java.net.Socket;
  9.  
  10. import estaticos.Encriptador;
  11.  
  12. public class Conector implements Runnable {
  13.     private Socket _socket;
  14.     private PrintWriter _out;
  15.     private Thread _thread;
  16.  
  17.     public Conector(int puerto) {
  18.         try {
  19.             _socket = new Socket(LuxEmu.IP_LOCAL, puerto);
  20.             _out = new PrintWriter(_socket.getOutputStream());
  21.             _thread = new Thread(this);
  22.             _thread.setDaemon(true);
  23.             _thread.start();
  24.         } catch (IOException e) {
  25.             Main.printError("\nINTENTANDO VOLVER A RECONECTAR CON EL REALM EN 5 SEGUNDOS");
  26.             try {
  27.                 Thread.sleep(5000L);
  28.             } catch (Exception localException2) {}
  29.             new Conector(LuxEmu.PUERTO_SERVIDOR);
  30.         }
  31.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement