Android Question AsyncStream sync problem

wl

Well-Known Member
Licensed User
Longtime User
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
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

wl

Well-Known Member
Licensed User
Longtime User
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
Top