B4J Question Raw Socket vs WebSockets

Jmu5667

Well-Known Member
Licensed User
Longtime User
Hello All

I have been educating myself on Web-sockets etc and they are very powerful and easy to implement. We have an up and coming server app to develop and I want to use B4J. The app must be multi-threaded as it is going to receive tracking data from many different GPS devices which will have different GPS protocols. Some of this devices operate in a fire and forget method and some of them require some form of acknowledgement.

I am sure it is possible to develop this server app using B4J but I have not been able to find any server examples that when a connection is created a new thread is created to handle the data exchange. There will be an MS SQL server back-end database so a DB thread pool will be required.

I would also like to know how threads are disposed of in this case.

I have seen other tracking apps that support many different devices and they assign a port number for each type of app. Is it possible to do something similar with B4J.

Many thanks for reading this and I look forward to all suggestions and advice.

Regards

John.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
I am sure it is possible to develop this server app using B4J but I have not been able to find any server examples that when a connection is created a new thread is created to handle the data exchange.
This is always the case with B4J WebSocket handlers. Each connection is managed by a different thread.

The threads are returned to the threads pool when the connection is closed.

I have seen other tracking apps that support many different devices and they assign a port number for each type of app
You don't need to use different ports. Use different paths instead.
 
Upvote 0

Jmu5667

Well-Known Member
Licensed User
Longtime User
Hi Erel

Thanks for the response. I thought with web sockets that the client also must use a web socket, am I wrong in thinking this ? Most devices just use a raw socket,open the port, transmit and close.


Regards

John.
 
Upvote 0

Jmu5667

Well-Known Member
Licensed User
Longtime User
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0
Top