Thursday, September 9, 2010

[android-developers] Re: Android NDK has a bug in socket recvfrom ????

On Sep 7, 10:02 pm, HISONA <hison...@gmail.com> wrote:
> When, I call recvfrom function, but "struct sockaddr *addr" parameter
> returns NULL value.
[...]
> int udp_read(int socket_no, char *str, int len, struct sockaddr
> *addr)
> {
>         int read;
>
>         return recvfrom(socket_no, str, len, 0, addr, &read);

The last argument is a value-result parameter ("fromlen") that should
hold sizeof(struct sockaddr) on entry. You're passing in an
uninitialized value. This will work or not depending on what value
happens to be passed in.

--
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
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate