RoUTP icon indicating copy to clipboard operation
RoUTP copied to clipboard

Crash on iOS7 when sending data.

Open ryanbourneuk opened this issue 10 years ago • 7 comments

I've encountered a crash when using RoUTP on iOS7 devices; it appears the data chunk, when passed to my game center delegate for sending, is equal to nil. This occurs despite the data object, passed into the RoUTP session, containing data.

This bug should occur when any data is passed into the RoUTP session. It occurs over Wifi and 3G networks.

Thanks, Ryan.

ryanbourneuk avatar Oct 12 '14 10:10 ryanbourneuk

It occurs on this line: [self.delegate session:self preparedDataForSending:chunk.encodedChunk];

of the ROUSession.m file.

ryanbourneuk avatar Oct 12 '14 10:10 ryanbourneuk

This might be what's happening to me too. *** Terminating app due to uncaught exception 'ROUException', reason: 'Encoded ack chunk is too short' getting thrown in [ROUAckChunk chunkWithEncodedChunk:]

robwasmann avatar Nov 10 '14 19:11 robwasmann

Oh I think it is because I am also trying to send some data using GKMatchSendDataUnreliable without using RoUTP since I don't need or want some data sent reliably. So it's receiving data that is 4 bytes and not 8 bytes. Would simply checking the sizeof the incoming data be a safe way to decide which way to process the data? That is, sending it through RoUTP or not.

robwasmann avatar Nov 10 '14 20:11 robwasmann

Hey,

You probably should be, instead of trying to distinguish between data sent with RoUTP or not, using RoUTP for both to ensure correct delivery.

I found my issue was caused by me not following the ReadMe correctly, especially with how I was setting the 'property' for it in the .h file. After changing some stuff around, it now works perfectly.

Ryan.

ryanbourneuk avatar Nov 10 '14 20:11 ryanbourneuk

Yeah some of my data packets will be much bigger than others, so it's not a good way to check. It's just that I have some data sent at 60 updates a second and it doesn't matter if it's received or not, anything missed is discarded.

robwasmann avatar Nov 10 '14 20:11 robwasmann

Well, in that case, you should probably attach a flag to each data packet, that shows whether it has been compressed or not; especially if you're willing to discard packets that were not received.

ryanbourneuk avatar Nov 10 '14 20:11 ryanbourneuk

Or maybe I can just inspect the header (or lack of) and decide that way. Well, everything is working now for me if I use RoUTP for all messages. Thanks for your help. And many thanks to the maker!! (rabovik)

robwasmann avatar Nov 10 '14 21:11 robwasmann