tufanv Expert Licensed User Longtime User Jan 14, 2019 #1 Hello, I am currently using httputils2 to get json data from mysql server on my server. I want to switch to websockets. Where should I start ? Is this server example valid for me: https://www.b4x.com/android/forum/threads/websocket-client-library.40221/ I don't understand where I push the data to b4a and b4i apps. is it this part ?: Code: ws.RunFunction("ServerTime", Array As Object(DateTime.Time(DateTime.Now))) ws.Flush So instead of servertime , I need to push my mysql database info which has 100 rows for the currencies. should I send all the data together as json and push it to devices and in b4i and b4a apps , get the data from this socket ? I am a bit lost about this, is what I am thinking is the correct way ? And also what method can I use to limit the websocket connections to my own apps only, to avoid other people use it ? Thanks
Hello, I am currently using httputils2 to get json data from mysql server on my server. I want to switch to websockets. Where should I start ? Is this server example valid for me: https://www.b4x.com/android/forum/threads/websocket-client-library.40221/ I don't understand where I push the data to b4a and b4i apps. is it this part ?: Code: ws.RunFunction("ServerTime", Array As Object(DateTime.Time(DateTime.Now))) ws.Flush So instead of servertime , I need to push my mysql database info which has 100 rows for the currencies. should I send all the data together as json and push it to devices and in b4i and b4a apps , get the data from this socket ? I am a bit lost about this, is what I am thinking is the correct way ? And also what method can I use to limit the websocket connections to my own apps only, to avoid other people use it ? Thanks
Erel B4X founder Staff member Licensed User Longtime User Jan 14, 2019 #2 tufanv said: Is this server example valid for me: Click to expand... Yes. tufanv said: I don't understand where I push the data to b4a and b4i apps. is it this part ?: Click to expand... Yes. Start with a small example and learn the basics of WebSockets. tufanv said: And also what method can I use to limit the websocket connections to my own apps only, to avoid other people use it ? Click to expand... You can send the username and password after the connection. Upvote 0
tufanv said: Is this server example valid for me: Click to expand... Yes. tufanv said: I don't understand where I push the data to b4a and b4i apps. is it this part ?: Click to expand... Yes. Start with a small example and learn the basics of WebSockets. tufanv said: And also what method can I use to limit the websocket connections to my own apps only, to avoid other people use it ? Click to expand... You can send the username and password after the connection.