public void disconnect()
  {
    try
    {
      if(out != null)
        out.close();
      if(in != null)
        in.close();
      if(socket != null)
        socket.close();
      if(ssl_socket != null)
        ssl_socket.close();
    }
    catch(IOException e)
    {
    }

    out = null;
    in = null;
    socket = null;
    ssl_socket = null;

    connected = false;
  }