socket permission on android platform

125 views
Skip to first unread message

Lili

unread,
Apr 15, 2009, 10:43:27 PM4/15/09
to android-platform
All,
I have a question about socket usage permission on android
platform:
Recently, we found, for a native process, if it isn't root , it
can't bind socket successfully. Our code looks like below:

ret = bind (socketFd, (struct sockaddr *) &addr, SUN_LEN
(&addr) );

we found it always return fail if the process isn't a root. As
the process is launched by a application service, is there anyone know
what we should do? Is it a limitation of android? And if yes, could
anyone explain in more details on the limitaion?

Best regards
lili

David Turner

unread,
Apr 16, 2009, 10:48:31 AM4/16/09
to android-...@googlegroups.com
On Unix, including Linux, you must be root to bind to any port < 1024
That might explain your problem. Another one is that your code doesn't have the internet-access permission
Reply all
Reply to author
Forward
0 new messages