On Tue, Feb 20, 2007 at 04:29:21AM -0800, Andrew Lentvorski wrote:
> Chris McCormick wrote:
> > I'm trying to use DSWifi to read UDP packets. This works fine, but
> > blocks on recv(). 'sys/poll.h' seems to be missing, and select() doesn't
> > seem to do what it's meant to (never get any results). Has anyone else
> > got UDP reading to work in a non-blocking way with DSWifi?
> IIRC, I used recvfrom() on a non-blocking socket in a tight loop to
> solve the problem you are seeing. Are you sure the socket has been set
> to non-blocking? I'm pretty sure I had to do something silly like use
> ioctl and FIONBIO to set it to non-blocking.
Something like this?
conn2 = socket(PF_INET, SOCK_DGRAM, 0);
fcntl(conn2, F_SETFL, O_NONBLOCK);
bind(conn2, (struct sockaddr *)&ser_addr2, sizeof(ser_addr2));
recv(conn2, buffIn, sizeof(buffIn), 0);
I would love to see the code that you have working because this doesn't
seem to work for me.
> Somebody really needs to sit down and port lwip to the DS.
Sounds good! I wish I had the time.