B4R Tutorial AsyncStreams Prefix Mode

rRandomAccessFile v1.80 adds support for AsyncStreams in prefix mode.
All B4X development tools use AsyncStreams for network communication and now all of them support prefix mode (https://www.b4x.com/android/forum/threads/asyncstreams-tutorial.7669/#content).

In prefix mode a 4 bytes header is added to each message with the message length. The NewData event will only be raised when there is a complete message available. You no longer need to handle split or merged messages.

It is recommended to increase the StackBufferSize setting to 600 or more. The default message size limit in prefix mode is 500. The default in non-prefix mode is 100.

AsyncStreams in prefix mode + B4RSerializator is the simplest way to communicate with other B4X applications.
 
Top