public static void connectToAgent(final _ISocketCallback socketCallback,
	                                    final HostPort hostPort)
	  {
	    if (hostPort.hostNameOrIpAddress.length() == 0)
	    {
	      socketCallback.setConnectionStatus("Error: Please enter an address");
	      socketCallback.setSocket(null);
	    }
	    else if (hostPort.port <= 0)
	    {
	      socketCallback.setConnectionStatus("Error: Please enter a port");
	      socketCallback.setSocket(null);
	    }
	    else
	    {
	      new Thread(new Runnable()
	      {
	        @Override
	        public void run()
	        {
	          socketCallback.setConnectionStatus("Connecting...");
	          final Socket socket = new Socket();
	          try
	          {
	            socket.connect(new InetSocketAddress(hostPort.hostNameOrIpAddress, hostPort.port));            
	            socketCallback.setSocket(socket);
	          }
	          catch (Exception e)
	          {
	        	  
	            socketCallback.setConnectionStatus("Error connecting to [" + hostPort.key() + "--" + e.getMessage() + " stack: " + Arrays.toString(e.getStackTrace()));
	            socketCallback.setSocket(null);
	          }
	        }
	      }).start();
	    }
	  }