B4J Question Which tutorial to follow for websockets?

tufanv

Expert
Licensed User
Longtime User
Hello,

I want to create a websocket server to push financial data to connected clients from our mysql server ( clients will use their own solution to connect to our websocket ) Which tutorial on b4x forums should I follow ? Autoconnecting websocket tutorial or general webapps tutorial that consists a websocket client ?

Thanks
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
I have a question with this. In this example, to send the servertime to clients it is used:
ws.RunFunction("ServerTime", Array As Object(DateTime.Time(DateTime.Now)))

I want to send a value from a mysql row and send it to clients,lets say usdvalue as int. Will i still use ws.runfunction ? How can i just send the int value ?
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
Yes.
B4X:
ws.RunFunction("EventName", Array (17))
Thanks but it always uses this format when sending to clients when I conenct with a client. My users will not use b4x, they will connect to websocket regularly so I only want to send What I want to send, is it possible to not to send prop: servertime and eytpe: runfunction and value ? which are added automaitaclly ?

{"prop":"ServerTime","etype":"runFunction","value":[51]}
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
All of the information in this thread is irrelevant. I thought that you are building a client with B4X. We cannot guess what you are doing.
You are right. What I am trying to do is, serve the data on mysql server which has price for latest currency pairs, to users connected via a weboscket client(not a b4x client).
 
Upvote 0
Top