0

I tried to send some message from android emulator to host machine using socket. On the host machine (ubuntu), android emulator which is socket client is running. The host is listening with specific port number (i.e. 9090) and the client sends messages when you open a specific html page, which embeds javascript code to send message through ip address and port number.

For this, I tested this methods with other machine or in the host machine. When I open the html page in other machines or host machine to send messages (client side), the host (ubuntu) gets them (no need to respond to client: it's like POST). However, Using the android emulator web browser, when I open the page, there's no message received in the server side. I guess the problem is port available/open in the emulator side.

Is there a way to open or create port number in the emulator side to send messages to Host machine? Or is there a sort of internal ip address between host machine and emulator..? I'm stuck with this.. Anyone can help me ?

4

1 回答 1

0

我发现一种解决方案是:只需使用网关向主机发送一些消息。就我而言, 10.0.2.2:9090 有效。

于 2013-06-20T21:12:54.623 回答