[android-developers] Re: unknown socket error -1

2008-12-02 Thread martin d.

Hi

* sal wrote/
schrieb:

 But i dont see  port#  being in listening state when i do netstat
 -a on windows XP machine.Strange part is its not generating any
 exception. because of this client is unable to connect to this port

I guess you only open a port inside the emulator and not on the host
machine. Have a look at the forwarding options of the emulator:
http://code.google.com/android/reference/emulator.html#portredirection

MartinD:
--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: unknown socket error -1

2008-12-02 Thread sal

Hi,

Thanks for your concern,

The problem with socketException got solved by putting INTERNET
permission in manifest.xml file.

But now i am encountering a new problem as follows

i have created Serversocket as follows

ServerSocket clientListenerSocket = new ServerSocket();

But i dont see  port#  being in listening state when i do netstat
-a on windows XP machine.Strange part is its not generating any
exception. because of this client is unable to connect to this port

I guess host OS is not allowing to allocate these ports. i would like
to know what could be the other reasons for this particular problem.
and what is the procedure to find free ports on Windows XP machine.


Thanks


On Dec 1, 7:58 pm, Huebi [EMAIL PROTECTED] wrote:
 You need to add the INTERNET permission to your app in the Manifest.
 That should solve the issue

 On 1 Dez., 15:27, sal [EMAIL PROTECTED] wrote:



  1. Can anyone point me to simple TCP client/server program on
  android ??

  2. Whenever i try to create socket with port and IPaddress i get
  IOException which points to a SocketException which gives a message
  unknown socket error -1 , it would be nice if someone could tell the
  root cause for this problem. i guess this is something to do with TCP
  settings of emulator.

  3. Do we need to have any configuration changes to Emulator or
  androidmanifest.xml file to eliminate this problem ?

  Thanks- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: unknown socket error -1

2008-12-02 Thread strazzere

Sal,

Just figured I'd post this here since it might become relevant for
you. If you come across the error:

12-01 18:27:52.175: WARN/System.err(764):
java.net.UnknownHostException: Host is unresolved: www.strazzere.com:80

This exception was thrown whenever .connect() or .getOutputStream()
where called.

Obviously www.strazzere.com is just an example, but you might find
that a known and resolvable host is getting the exception thrown, the
trick is to restart the emulator. It seems to lose something if you
change network connections or go in/come out of hibernation mode.

Sorry if this seems off topic, but I wasn't able to find a solution to
my problem yesterday so I figured I'd post this here!

Best of luck,

-Tim Strazzere

On Dec 2, 4:21 am, sal [EMAIL PROTECTED] wrote:
 Hi,

 Thanks for your concern,

 The problem with socketException got solved by putting INTERNET
 permission in manifest.xml file.

 But now i am encountering a new problem as follows

 i have created Serversocket as follows

 ServerSocket clientListenerSocket = new ServerSocket();

 But i dont see  port#  being in listening state when i do netstat
 -a on windows XP machine.Strange part is its not generating any
 exception. because of this client is unable to connect to this port

 I guess host OS is not allowing to allocate these ports. i would like
 to know what could be the other reasons for this particular problem.
 and what is the procedure to find free ports on Windows XP machine.

 Thanks

 On Dec 1, 7:58 pm, Huebi [EMAIL PROTECTED] wrote:

  You need to add the INTERNET permission to your app in the Manifest.
  That should solve the issue

  On 1 Dez., 15:27, sal [EMAIL PROTECTED] wrote:

   1. Can anyone point me to simple TCP client/server program on
   android ??

   2. Whenever i try to create socket with port and IPaddress i get
   IOException which points to a SocketException which gives a message
   unknown socket error -1 , it would be nice if someone could tell the
   root cause for this problem. i guess this is something to do with TCP
   settings of emulator.

   3. Do we need to have any configuration changes to Emulator or
   androidmanifest.xml file to eliminate this problem ?

   Thanks- Hide quoted text -

  - Show quoted text -
--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: unknown socket error -1

2008-12-02 Thread sal

Hi Martin,

I am listening in my code on port# ie emulator, so what is
relevence of port redirection in this scenario,

for e.r if i do port redirection as follows

add tcp:: , then to which port client has to send request
wheather to  or 


Thanks
Suhail

On Dec 3, 1:37 am, strazzere [EMAIL PROTECTED] wrote:
 Sal,

 Just figured I'd post this here since it might become relevant for
 you. If you come across the error:

 12-01 18:27:52.175: WARN/System.err(764):
 java.net.UnknownHostException: Host is unresolved:www.strazzere.com:80

 This exception was thrown whenever .connect() or .getOutputStream()
 where called.

 Obviouslywww.strazzere.comis just an example, but you might find
 that a known and resolvable host is getting the exception thrown, the
 trick is to restart the emulator. It seems to lose something if you
 change network connections or go in/come out of hibernation mode.

 Sorry if this seems off topic, but I wasn't able to find a solution to
 my problem yesterday so I figured I'd post this here!

 Best of luck,

 -Tim Strazzere

 On Dec 2, 4:21 am, sal [EMAIL PROTECTED] wrote:



  Hi,

  Thanks for your concern,

  The problem with socketException got solved by putting INTERNET
  permission in manifest.xml file.

  But now i am encountering a new problem as follows

  i have created Serversocket as follows

  ServerSocket clientListenerSocket = new ServerSocket();

  But i dont see  port#  being in listening state when i do netstat
  -a on windows XP machine.Strange part is its not generating any
  exception. because of this client is unable to connect to this port

  I guess host OS is not allowing to allocate these ports. i would like
  to know what could be the other reasons for this particular problem.
  and what is the procedure to find free ports on Windows XP machine.

  Thanks

  On Dec 1, 7:58 pm, Huebi [EMAIL PROTECTED] wrote:

   You need to add the INTERNET permission to your app in the Manifest.
   That should solve the issue

   On 1 Dez., 15:27, sal [EMAIL PROTECTED] wrote:

1. Can anyone point me to simple TCP client/server program on
android ??

2. Whenever i try to create socket with port and IPaddress i get
IOException which points to a SocketException which gives a message
unknown socket error -1 , it would be nice if someone could tell the
root cause for this problem. i guess this is something to do with TCP
settings of emulator.

3. Do we need to have any configuration changes to Emulator or
androidmanifest.xml file to eliminate this problem ?

Thanks- Hide quoted text -

   - Show quoted text -- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: unknown socket error -1

2008-12-01 Thread Huebi

You need to add the INTERNET permission to your app in the Manifest.
That should solve the issue

On 1 Dez., 15:27, sal [EMAIL PROTECTED] wrote:
 1. Can anyone point me to simple TCP client/server program on
 android ??

 2. Whenever i try to create socket with port and IPaddress i get
 IOException which points to a SocketException which gives a message
 unknown socket error -1 , it would be nice if someone could tell the
 root cause for this problem. i guess this is something to do with TCP
 settings of emulator.

 3. Do we need to have any configuration changes to Emulator or
 androidmanifest.xml file to eliminate this problem ?

 Thanks
--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---