Code example for SocketException

Methods: printStackTrace

0
		try { 
			socket = new DatagramSocket();
			serverAddress = InetAddress.getByName("192.168.1.133");
		} catch (SocketException e) {
			Log.e("GESTURE", "SOCKET ERROR");
			e.printStackTrace();
		} catch (UnknownHostException e) {
			Log.e("GESTURE", "HOST ERROR");
			e.printStackTrace();
		} 
		byte[] buf;
		buf = gesture.getBytes();
		 
		DatagramPacket packet = new DatagramPacket(buf,  buf.length, serverAddress, 5005);
		try { 
			socket.send(packet);
			Log.d("GESTURE", "ASYNC");
		} catch (IOException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		}