Hi,
still porting Squeak to android (http://code.google.com/p/squeak-
android-vm/) - i encounter problems with server-sockets.
Server-Sockets (listening on ports > 1024) seem to crash the
application immediatly when a connection get's established.
The Socket-Part is a straighforward unix-socket implementation in
plain "C".
Added android.permission.INTERNET - do i need more permissions to
setup server-sockets?
Or is it disallowed to use server-sockets with the ndk?
Regards,
Stefan
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
Do you know if you're actually getting a valid server socket? Last time that I checked, Linux doesn't let non-root open server sockets on ports under (or equal to?) 1024.
Tristan Miller
On Mar 19, 2010 12:59 PM, "David Turner" <di...@android.com> wrote:
On Fri, Mar 19, 2010 at 9:29 AM, Stefan Krecher <stefan....@googlemail.com> wrote:
>
> Hi,
> sti...
"crashing the application" is certainly not acceptable behaviour. If you don't have the INTERNETpermission, stuff like bind() or connect() should return -1 with errno set to EPERM or something.Does your application check for error codes ? If so, what are they ?
>
> The Socket-Part is a straighforward unix-socket implementation in
> plain "C".
> Added androi...
Absolutely not, as long as you have the INTERNET permission, you will be able to connect/bind to UDP/TCP sockets.You can bind/connect to Unix-domain sockets without this permission (with the usual uid/gid restrictions on the filebeing used for the socket).
>
> Regards,
> Stefan
>
> --
> You received this message because you are subscribed to the Google...
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
...
On 19 Mrz., 18:07, Tristan Miller <trisman...@gmail.com> wrote:
> Do you know if you're actually getting a valid server socket? Last time
> that I checked, Linux doesn't let non-root open server sockets on ports
> under (or equal to?) 1024.
i did some further investigations: the server-socket is valid, and the
listen()-call returns with no error.
The application uses i/o multiplexing via fd_set / select() etc, but
the accept-handler is never called.
Are there any known issues regarding i/o multiplexing on android? This
mechanism works fine on other Linux-derivates.
regards,
Stefan
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
On 25 Mrz., 18:19, David Turner <di...@android.com> wrote:
> No issues that I know how. There are several uses of select() and epoll()
> within the system, so I doubt that's the issue here.
> Can you give a little more details about what you're doing ?
it's the socket-implementation for the smalltalk/ squeak-vm - i did
not code that stuff, just try to understand it and to port it to
android ...
After studying the code, i had another idea: could it be a problem
with SIGIO? I'm not sure if i understood the signalling right: a
socket in listening-state/ waiting for connections, sends SIGIO, when
a client tries to connect.
Here's a piece of code:
/* enable non-blocking asynchronous i/o and delivery of SIGIO to the
active process */
[...]
arg= getpid(); if (ioctl(fd, SIOCSPGRP, &arg) < 0)
perror("ioctl(SIOCSPGRP, getpid())");
arg= 1; if (ioctl(fd, FIOASYNC, &arg) < 0)
perror("ioctl(FIOASYNC, 1)");
yes, maybe you're right. But this code works on a lot of platforms and
it would be a big deal to rewrite it.
Looking into the LogCat, there's another reference to SIGIO:
"Process 731 terminated by signal (29)"
according to asm/signal.h, 29 is SIGIO (and SIGPOLL = SIGIO)
the last line in the dmesg-output is: "<6>binder: 818:818 transaction
failed 29189, size 88-0"
what did you mean with "kernel configuration issue"?
On Mar 26, 2:57 am, David Turner <di...@android.com> wrote:yes, maybe you're right. But this code works on a lot of platforms and
> According to Wikipedia, SIGIO == SIGPOLL and does only work with poll()
>
> http://en.wikipedia.org/wiki/SIGIO
>
> <http://en.wikipedia.org/wiki/SIGIO>It may be a kernel configuration issue.
> But very frankly, there must be a better way to do that than a signal.
it would be a big deal to rewrite it.
Looking into the LogCat, there's another reference to SIGIO:
"Process 731 terminated by signal (29)"
according to asm/signal.h, 29 is SIGIO (and SIGPOLL = SIGIO)
the last line in the dmesg-output is: "<6>binder: 818:818 transaction
failed 29189, size 88-0"
what did you mean with "kernel configuration issue"?