I have an server-client application on android which support messaging between clients. ı run server and client program on different emulator on the same computer. when server is listening the port, client try to connect it with these statements.
String serverIpAddresss = "10.0.2.2";
InetAddress addr = InetAddress.getByName(serverIpAddresss);
Socket socket = new Socket(addr,REDIRECTED_SERVERPORT);
and before that i redirected 5000:6000 because 5000 is client and 6000 is server's port. new socket line it doesnt work and doesnt create socket. Can anybody help me how to connect client and server and how to communicate with eachothers?