peacemaker Expert Licensed User Longtime User Oct 2, 2013 #1 Hi, Receiving from port Code: Copy Sub AStream_NewData (Buffer() As Byte) ProgressDialogHide Dim a As String a = BytesToString(Buffer, 0, Buffer.Length, "UTF8") and buffer is always different length, the string "test" sent is received letter by letter in this sub. Sometime 2 letters together, and later others one by one. How to be sure that whole the reply is fully received ?
Hi, Receiving from port Code: Copy Sub AStream_NewData (Buffer() As Byte) ProgressDialogHide Dim a As String a = BytesToString(Buffer, 0, Buffer.Length, "UTF8") and buffer is always different length, the string "test" sent is received letter by letter in this sub. Sometime 2 letters together, and later others one by one. How to be sure that whole the reply is fully received ?
Erel B4X founder Staff member Licensed User Longtime User Oct 2, 2013 #2 The question is whether there is a standard character that ends each message. Check this class [class] AsyncStreamsText - Useful when working with streams of text It works with messages that end with an end of line character. Upvote 0
The question is whether there is a standard character that ends each message. Check this class [class] AsyncStreamsText - Useful when working with streams of text It works with messages that end with an end of line character.
peacemaker Expert Licensed User Longtime User Oct 2, 2013 #3 Thanks, Erel, But how to be if the other side is the ready device working with some fixed system prefix "qwerty" ? And CRLF not used. Upvote 0
Thanks, Erel, But how to be if the other side is the ready device working with some fixed system prefix "qwerty" ? And CRLF not used.
Erel B4X founder Staff member Licensed User Longtime User Oct 2, 2013 #4 You should implement something similar to AsyncStreamsText. You should collect the characters with a StringBuilder and check whether you have a complete message. Upvote 0
You should implement something similar to AsyncStreamsText. You should collect the characters with a StringBuilder and check whether you have a complete message.
peacemaker Expert Licensed User Longtime User Oct 2, 2013 #5 I suspected this :-( thanks :0) Upvote 0