public void connect(String server, String port, boolean ssl_enabled)
  {
    try
    {
      if(ssl_enabled)
      {
        System.setProperty("https.protocols", "SSLv3");
        SSLSocketFactory f = (SSLSocketFactory)SSLSocketFactory.getDefault();
        ssl_socket = (SSLSocket)f.createSocket(server, Integer.parseInt(port));
        String[] protocols = { "SSLv3" };
        ssl_socket.setEnabledProtocols(protocols);
        in = new BufferedReader(new InputStreamReader(ssl_socket.getInputStream()));
        out = new BufferedWriter(new OutputStreamWriter(ssl_socket.getOutputStream()));
      }
      else
      {
        socket = new Socket(server, Integer.parseInt(port));
        in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
        out = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
      }
    }
    catch(NumberFormatException e)
    {
      connected = false;
      return;
    }
    catch(UnknownHostException e)
    {
      connected = false;
      return;
    }
    catch(IOException e)
    {
      connected = false;
      return;
    }

    connected = true;
  }