SimpleChat(String nickname)
	{
		// Singleton:
		sc = this;
		this.senderNickname = nickname;
		// Get all the Gateways.

		try
		{
			GatewayDiscover gatewayDiscover = new GatewayDiscover();
			Map<InetAddress, GatewayDevice> gateways = gatewayDiscover.discover();
			if (gateways.isEmpty())
			{
				System.err.println("Seems like you are not connected to the internet");
			}
			// Select the first good gateway:
			gateway = gatewayDiscover.getValidGateway();

			if (null == gateway)
			{
				System.err.println("No active gateway device found.");
				// No active gateway device found. Error :C
			}
			setGwIp(gateway.getExternalIPAddress());
			setPort(new PortSelector(gateway).getPortSelected());
			gateway.addPortMapping(port, port, gateway.getLocalAddress()
			        .getHostAddress(), "TCP", "SimpleChat");
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
		// If i come here, i've found a free port both on the local pc and on
		// the Gateway Device
		this.gui = new Gui(nickname);
		createListener();

	}