W wl Well-Known Member Licensed User Longtime User Sep 1, 2013 #1 Hello, I have a problem in my TCP communication that is very hard to reproduce. Hence my question: is it possible that the event B4X: ... _NewData (buffer() as Byte) is being triggered a second time while the code in it is still being executed ? Thanks !
Hello, I have a problem in my TCP communication that is very hard to reproduce. Hence my question: is it possible that the event B4X: ... _NewData (buffer() as Byte) is being triggered a second time while the code in it is still being executed ? Thanks !
KitCarlson Active Member Licensed User Longtime User Sep 2, 2013 #2 It is necessary to append buffer contents, and process completed packets, removing from buffer. Complete data, does not always arrive in one _NewData. Upvote 0
It is necessary to append buffer contents, and process completed packets, removing from buffer. Complete data, does not always arrive in one _NewData.
W wl Well-Known Member Licensed User Longtime User Sep 2, 2013 #3 Hi KitCarlson, Thank you for the info, but I was aware of this and I do exactly what you suggest: create a buffer. But I was wondering whether the NewData is Always called on the same thread (so I don't run into threading issues within the code of this event). Thanks Upvote 0
Hi KitCarlson, Thank you for the info, but I was aware of this and I do exactly what you suggest: create a buffer. But I was wondering whether the NewData is Always called on the same thread (so I don't run into threading issues within the code of this event). Thanks
Erel B4X founder Staff member Licensed User Longtime User Sep 2, 2013 #4 NewData event is called on the main thread. This means that you do not need to worry about any threading issues. Upvote 0
NewData event is called on the main thread. This means that you do not need to worry about any threading issues.