Android emulator(client) to phone(server) socket connection
===

i'm currently attempting to connect emulator(client) and phone(server) through TCP/IP socket connection. But somehow it never works, but it works fine if i try to connect emulator (as client / server) with internal java program (as client / server), also socket connection works fine from phone to applications that's not on emulator. I thought it has something to do with port forwarding so I've tried:

sourced from ="http://stackoverflow.com/questions/5064304/how-can-i-forward-my-localhost-ip-address-to-an-android-emulator"

    telnet localhost 5554

    redir add tcp:1337:12345

But when i test my client side with port number 1337 and server side 12345, it still doesn't work, server code doesn't .accept() client's request.

Following is my client(emulator) and server(phone) code for accepting and setting up io streams

client: 

SERVER_IP is the local ip address

    connection = new Socket(SERVER_IP, PORT);

    private void setUpStreams() throws IOException {
    			output = new ObjectOutputStream(connection.getOutputStream());
    			output.flush();
    			input = new ObjectInputStream(connection.getInputStream());
    		}

Server: 

That's for accepting user
    private void acceptingUser() {
    
    		try {
    			ss = new ServerSocket(PORT, 10);
    			connection = ss.accept();
    			connected = true;
    			osm.updateInChatStatus(1);
    		} catch (IOException e) {
    			// TODO Auto-generated catch block
    			Log.i("serv", "Wasn't able to connect with any clients!: " + e);
    		}
    	}

and setting up stream is pretty much similar to the client's one. Thanks in advance for ur advices and solutions.