Cannot open socket when incoming call in Android : I try to send data to server when incoming call through mobile data (4G).
I get one of these errors:

java.net.UnknownHostException: Host is unresolved: xyz.xy

or

java.net.SocketTimeoutException: failed to connect to /xxx.xxx.xxx.xxx (port yyyyyy) after 15000ms

When is WIFI on, data is sending during incoming call.

Here is part of code:

    Socket socket = new Socket();
		DataOutputStream dos;
		DataInputStream dis;
		try {
			socket.connect(new InetSocketAddress(SERVER_IP, SERVER_PORT), CONNECTION_TIMEOUT);
			socket.setTcpNoDelay(true);
			socket.setSoTimeout(READ_TIMEOUT);
			dos = new DataOutputStream(socket.getOutputStream());
			dis = new DataInputStream(socket.getInputStream());

			int count = text.getBytes("UTF-8").length;
			ByteBuffer data = ByteBuffer.allocate(count);
			data.put(text.getBytes("UTF-8"));

			dos.write(data.array(), 0, data.array().length);

Is a problem send data through mobile data (4G) when incomming call? Or I am missing any settings?