Websocket Server gets a data from the mysql server with mysql connector on the main sub and on the ws module it manages the websocket connections and serves this data
Please note that the Main.Cursor.NextRow call in one WebSocket connection affects ALL WebSocket connections. You either need to
a) Use pooling and do your SELECT in each WebSocket connection and you can use the usersymbols list to create a SQL statement (parameterized) to send to the SQL server. Then use the results to process your return string
b) In main, store the SQL results in a list and process this list in your WebSocket handlers (although we may have access contention issues at this point -> the list may get build as we try to access it from the websocket handler)
c) Store the results in a local SQLite DB (on disk or in memory) and query it in the WebSocket handler
If at all possible, I would use option a. Use option c if you think you can query the SQL server back end so often (you are limited in the number of requests you can send to it) or if the back end SQL server connection is slow.
Minor nitpick: Don't use & to concatenate strings in B4J, especially if you are building a longer string. Each & will create a new string (since strings are immutable in B4X). Use StringBuilder to build the strings. I've seen cases where & caused memory and timing issues (& is not only memory intensive, but processing intensive).