Loosen the connection timeouts. Remove the HTTP request timeout because it depends on how long it takes for the requested app to start.
Set the datagram destination manually for ping packets rather than connecting the datagram socket explicitly. This prevents the ICMP port unreachable message from being propagated to the receive thread which causes an IOException.