Loris Anoardi Member Licensed User Longtime User Apr 15, 2014 #1 Hello to everyone, I have a problem with a socket. I connect to a server like the example in http://www.b4x.com/android/forum/threads/asyncstreams-tutorial.7669/ (not using the prefix mode). The problem is that in the emulator i receive a long string in once in the AStreams_NewData event. Using the smartphone the AStreams_NewData event is raised more time. Each time it receive a ca 800 bytes string with some points at the end "...................". How can i receive the whole string like in the emulator?? Thanks and sorry for my english. Loris Anoardi
Hello to everyone, I have a problem with a socket. I connect to a server like the example in http://www.b4x.com/android/forum/threads/asyncstreams-tutorial.7669/ (not using the prefix mode). The problem is that in the emulator i receive a long string in once in the AStreams_NewData event. Using the smartphone the AStreams_NewData event is raised more time. Each time it receive a ca 800 bytes string with some points at the end "...................". How can i receive the whole string like in the emulator?? Thanks and sorry for my english. Loris Anoardi
Erel B4X founder Staff member Licensed User Longtime User Apr 16, 2014 #2 This is how network communication works. Messages can be split or merged. Prefix mode takes care of it by prefixing each message with its length. Another option is to use AsyncStreamsText which waits for an end of line character. Upvote 0
This is how network communication works. Messages can be split or merged. Prefix mode takes care of it by prefixing each message with its length. Another option is to use AsyncStreamsText which waits for an end of line character.
Loris Anoardi Member Licensed User Longtime User Apr 16, 2014 #3 Veri good, thanks!! AsyncStreamsText Is great Last edited: Apr 16, 2014 Upvote 0