Anil
unread,Mar 30, 2009, 3:16:47 AM3/30/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to android-porting, anil.n...@stericsson.com
Hi,
I have defiend a dameon which I have invoked from init.rc. This
daemon wait on socket.
-------------init.rc code
service myserviced system/bin/myserviced
user root
oneshot
-------------
Every time I flash the image, the first time I am able to bind to
the socket. But on restart, I get error (98- Unable to bind to socket)
when binding to the socket.
Code snippet for socket server is as below:
-----------------
if( (ListenerFd = socket(AF_LOCAL, SOCK_STREAM, 0)) < 0)
exit(0);
}
bzero(&srv, sizeof(srv));
srv.sin_family = AF_LOCAL;
srv.sin_addr.s_addr = INADDR_ANY;
srv.sin_port = htons(PORT);
if( bindStatus = bind(ListenerFd, (struct sockaddr *) &srv, sizeof
(srv)) < 0) {
LOGD("agpsserver.c: Error: bind %d\n", errno);
exit(1);
}
--------------
Thanks in advance
Anil