Code example for UnknownHostException

Methods: getMessage, printStackTrace

0
			Log.d(TAG, "Getting the socket ready");
			socket = new Socket(IP, PORT);
			setSocketAlive(true); 
		} catch (UnknownHostException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
			Log.d(TAG, e.getMessage());
			setSocketAlive(false); 
		} catch (IOException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
			Log.d(TAG, e.getMessage());
			setSocketAlive(false); 
		} 
    } 
     
    public void setOutput() { 
		if (isSocketAlive()) { 
			try { 
				printWriter = new PrintWriter(socket.getOutputStream(), true);
				printWriterAlive = true;