LoginLogin

Cummunication buffer overflow ERROR please explain

Root / Programming Questions / [.]

TarudahatCreated:
What does a "Cummunication buffer overflow " mean I'm getting it from MPSEND

MPSEND has a character limit of 100 so if you're sending messages longer than 100 characters, that could be what's causing it.

It's not the character limit (which is 128 characters, or 256 bytes). That gives the error "String is too long". "Communication buffer overflow" happens when you try to send data with MPSEND faster than the 3DS can actually send it. Rather than pausing your program until the data is actually sent, MPSEND puts the data you give it into a buffer, which is later sent in the background. If you run MPSEND too often (for example, in a loop without VSYNC or WAIT), the buffer can end up filling up before the data can be sent, resulting in this error. The amount of data you can send isn't much, somewhere around 300 characters per frame, if that. Make sure the main loop of your program uses VSYNC, to ensure that it runs only once per frame. Do what you can to keep the size of the data you're sending as small as possible, too. If you do need to send a large amount of data, consider breaking it into parts and sending one part each frame instead.

cool

I remember figuring out the maximum transfer rate a long time ago, I believe it was like, MPSENDing 128 chars every 3 frames, but do some tests to figure out what's possible because that might be wrong.

There's definitely a difference between sending "A" 128 times, and sending "A"*128 once. There's probably some amount of overhead for each MPSEND call, since presumably it has to store the length for each message.

I remember figuring out the maximum transfer rate a long time ago, I believe it was like, MPSENDing 128 chars every 3 frames, but do some tests to figure out what's possible because that might be wrong.
Yea I got it working by only using it in every. 3rd frame.