public DatagramSocket connection(String name, String address, int port) 
    {
        this.name = name;
        this.address = address;
        this.port = port;
        
        System.out.println("In method 'Connection' - here");
        
//        boolean connect = initiateConnection(address, port);
        
         
        try 
        {
        	
        	if(clientSocket == null)
        	 clientSocket = new DatagramSocket(port);
             ip = InetAddress.getByName(address);

             
         	controller.console(controller.getCurrentTime() + "Attempting a connection to " + address + ":" + port + ", user: " + name + "\n");
         	System.out.println("History: \n" + controller.getHistory().getText());
         	
         	if(port > 1024)
         	{
         		
         		try 
         		{
             		dataHandler(controller.getCurrentTime() + "SYSTEM " + name + " has logged in.", controller.getIp());

 				} 
         		catch (Exception e) 
 				{
 				
 					controller.console(controller.getCurrentTime() + "Unknow host!");
 					e.printStackTrace();
 				}
         		
         	}
         	else
         	{
         		controller.console(controller.getCurrentTime() + "An unknow error have occured.");
                controller.console(controller.getCurrentTime() + "Connection failed!");
         	}
             

         	return clientSocket;
        }
        catch (UnknownHostException e) 
        {
                e.printStackTrace();
                
        } 
        catch (SocketException e) 
        {
                e.printStackTrace();
               
        }
        
        return clientSocket;
   
        	
}