Hi Android n00b,

http://groups.google.com/group/android-developers/browse_thread/thread/acd93714ebb3b2fc/101c925eeefaed15
<http://groups.google.com/group/android-developers/browse_thread/thread/acd93714ebb3b2fc/101c925eeefaed15>
Cheers,
James

On Thu, Oct 8, 2009 at 12:57 PM, Android_n00b <[email protected]> wrote:

>
> Hi,
>
> I am trying to create a connection between a server socket program
> written in C and an android client socket program. Now when I write a
> regular java client program such as:
>
> try
> {
>        Socket socket = new Socket("localhost", 5554);
>        PrintWriter out = new PrintWriter(echoSocket.getOutputStream
> (), true);
> }
> catch(Exception e)
> {
>              //................
> }
> out.println("Hello World");
>
> This program works perfectly and my server.c file receives the
> message.
> However, when I try the same program with the Android Emulator, I get
> an "Error:java.net.ConnectException: localhost/127.0.0.1:5554 -
> Connection refused" I have tried different ports as well (8888, 3490).
> This works perfectly with the regular Java project, but the moment I
> write the same code in an Android project I get that error. I have
> been stuck on this all day and am really getting frustrated :( Would
> appreciate any help!
> >
>

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

Reply via email to