B4J Question Messenger Server (like XMPP)

narek adonts

Well-Known Member
Licensed User
Hi,

I am trying to develop a messenging server with B4J.
few questions.

for each connected user I am creating a new class and handle the socket and the Async in this class.
1. Each class is a separate Thread?

2. How many simultaneous users can handle with the server socket?

thank you

Narek
 

Erel

Administrator
Staff member
Licensed User

narek adonts

Well-Known Member
Licensed User
I had a look on the sources that you advised.
I think that.

1. I dont want to use websockets for the server
2. Jetty was a bit complicated for me.
3. I am planning to use AsyncStreams

Thus, I would like to know for example if I am using each connected socket in a spereate class, will it be multithreaded?

How do you think, can I achive to create a server with ServerSocket which can handle 100,000 active connections?

Narek
 

Erel

Administrator
Staff member
Licensed User
Thus, I would like to know for example if I am using each connected socket in a spereate class, will it be multithreaded?
AsyncStreams uses background threads to manage the communication. The events are raised on the main thread. It doesn't matter whether you use a separate class.

How do you think, can I achive to create a server with ServerSocket which can handle 100,000 active connections?
You will not be able to handle this number of connections with ServerSocket.

A well written server based on jServer will also not be able to support 100,00 active connections. Though it will still support about 100 times more connections than ServerSocket.
 
Top