Emulator sockets trouble

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

Emulator sockets trouble

Postby Vi42526 » Sun May 15, 2011 6:22 pm

Hello. I'm programming an application for Android 2.3.3 but I'm having problem with emulator sockets. I need to create a socket connection between Android emulator on one computer and a server on another computer (the computers are in the same network). My application uses two ports to communicate, 5000 and 5001 and the server is listening on the port 12345. When the application starts it tries to connect to the other computer and sends it it's ip addres and port numbers so they can communicate. The server receives these parameters but when it tries to open a socket towards the emulator the socket times out. My application has the INTERNET permission and I have redirected ports 5000 and 5001 to 5557 and 5558. I've been having this problem the whole week and I don't know what to do anymore.

P.S. When I used this code to connect two computers together instead of an emulator and a computer it worked perfectly. The two computers can communicate without any truble.
Vi42526
Freshman
Freshman
 
Posts: 4
Joined: Sun May 15, 2011 5:55 pm

Top

Re: Emulator sockets trouble

Postby Vi42526 » Tue May 17, 2011 5:32 pm

I think I've finally figured it out. It seems that the emulator does not behave well as a server trying to accept connections from an outside computer. The solution is here: http://stackoverflow.com/questions/3990 ... d-emulator
Vi42526
Freshman
Freshman
 
Posts: 4
Joined: Sun May 15, 2011 5:55 pm

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 4 guests