Other [B4x]Are requests via Sockets/AsyncStreams queued?

KMatle

Expert
Licensed User
Longtime User
I'm using multiple Sockets/AsyncStreams for a server solution (B4J as the server, B4A apps as clients). So if multiple connected clients send data at "one time", will they be queued? (I assume there is no multithreading, so they will be queued and processed first in first out).
 

KMatle

Expert
Licensed User
Longtime User
Each AsyncStreams object uses a different thread to read the data and is not affected by other instances. The NewData event is raised on the main thread.

So then it's serialized in the main thread? I'm thinking to use global variables to hold the received data until it's processed. Right now I create new instances for every received data and I have to reach it through all subs I call while processing.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
So then it's serialized in the main thread?
Yes.

I'm thinking to use global variables to hold the received data until it's processed.
Doesn't sound like a good idea.

Implement the logic in a class and create a class instance for each connection.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…