Code example for UnknownHostException

Methods: printStackTrace, sleep

0
				objectInputStream = new ObjectInputStream(socket.getInputStream());
			} 
			objectOutputStream.writeObject(this.command);
		} catch(UnknownHostException e) {
			Log.v("socket", "Uknown host exception");
			e.printStackTrace();
		} catch (IOException e) {
			Log.v("socket", "IO exception");
			e.printStackTrace();
		} 
		 
		if(stop)
			closeConnection(); 
		 
		return null; 
	} 
	 
	public static void closeConnection() { 
		try { 
			objectOutputStream.writeObject("DISCONNECT");
			Thread.sleep(1000);
			socket.close();
			objectOutputStream.close();
			objectInputStream.close();
			socket = null;
			objectInputStream = null;