B4J Question Sockets and threading

wl

Well-Known Member
Licensed User
Longtime User
Hi,

As I understood in the past sockets are not working in a Multi-threaded way. All calls are serialized.
Is there any way in running them in different threads ? The webserver (which is multithreaded) is not really an option for me.

Thanks !
 

wl

Well-Known Member
Licensed User
Longtime User
Hi Erel,

Thanks but I am a bit lost. If using Sockets with Asyncstreams then I guess internally the communication is multithreaded, but the events are serialized, is that it ?

I was just wondering how stable/performant it is to write a Socket server application in B4J when multiple connections are being made.

Thanks.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
That is correct. The events are executed on the main thread.

I was just wondering how stable/performant it is to write a Socket server application in B4J when multiple connections are being made.
It is very stable and the performance should be good assuming that you are not blocking the main thread for too long.

The question is how many concurrent connections do you want to handle? A real server should be implemented with jServer library.
 
Upvote 0
Top