gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Problem sending data over DSWifi

#136706 - c99koder - Fri Aug 03, 2007 11:45 pm

Hello,

I am using DSWifi w/ the sgIP stack to send/receive files on the DS. Receiving is fine, but I'm having problem sending. It seems like when I call send() it interrupts the previous send() if it hadn't finished transmitting, and I end up losing data.

I've tried reducing the size of the chunks I pass to send() and adding a few swiWaitForVBlank() calls in between and it seems to help a little, but I do still occasionally lose data.

Is there a reliable way to know when sgIP has finished sending the previous chunk so I can send the next? I haven't put the socket into non-blocking mode, so send() is supposed to be block until it's finished anyway.

Thanks!

#136742 - simonjhall - Sat Aug 04, 2007 11:55 am

I originally had problems like this when I started using wifi (over a year ago - things may have changed). I was losing data sometimes if the data I wanted to send was over the size of the payload of an IP packet. Normally when this happens the packet should get broken up into pieces and sent separately (called fragmentation), but it didn't always work.
Ok, it doesn't sound too related to your problem but I'm sure it happened the more frequently I sent data!
Also in more recent projects if I send data too fast (ie too often) I seem to overflow the buffers and my packets take longer and longer to get out of the machine, until eventually they get dropped...

So - I'd have a go at reducing the data size per packet (< 1kb) and reducing the frequency of the sending of the data.
_________________
Big thanks to everyone who donated for Quake2