I am listening out for requests using the following method:

serverSocket = new ServerSocket(18081);
appendText("\nlistening..." );
Socket client = serverSocket.accept();
appendText("\nrequest");

The program outputs "listening...", but then blocks at
serverSocket.accept(), so "request" is never output.  I'm pretty sure
this is correct behaviour.  However, nothing I do seems to be able to
get the thing past this point!

I understand there are issues with ports/ip addresses and the
emulator, but I'm (also) trying this on a G1 device (though hooked up
via USB - software wont run if I unhook it from the USB port,
something to do with signing, but does it make a difference anyway?).
I have enabled the INTERNET permission, are there any others I need to
enable?

I've tried using a web browser and a telnet app on both my pc and the
device itself, and pointed them to the phone's IP (tried localhost,
127.0.0.1, and the device's global IP) using port 18081. My code just
doesn't do anything at all, just sits there merily waiting for a
client to connect to the socket.

Am I even testing this correctly? using telnet/web browser should make
it do *something* surely?

All the info I've found on the web is about the emulator, or
connecting to remote servers, or running client and server in the same
application... not running a server on the device itself and trying to
connect via an external program or from an external site.

Tearing my hair out here.  Any advice MUCH appreciated.

Dave.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to