@@ -240,34 +240,51 @@ This is a special automatic backfill request command that is sent to the server
240
240
` ` ` sh
241
241
{" cmd" :" bfsym" ," arg" :" y SYM1 3" }
242
242
` ` `
243
+
243
244
# #### c) ALL symbol backfill
244
245
{" cmd" :" bfall" ," arg" :" x" }
245
246
` ` ` sh
246
247
{" cmd" :" bfall" ," arg" :" x" }
247
248
` ` `
248
249
For ALL Symbol backfill, client application should still send individual Json-hist messages for each symbol.
250
+
249
251
# #### d) ADD symbol to SUBSCRIBE rtd
250
252
{" cmd" :" addsym" ," arg" :" SYMBOL_NAME" }
251
253
` ` ` sh
252
254
{" cmd" :" addsym" ," arg" :" SYM10" }
253
255
` ` `
256
+
254
257
# #### e) REMOVE symbol OR UNSUBSCRIBE rtd
255
258
{" cmd" :" remsym" ," arg" :" SYMBOL_NAME" }
256
259
` ` ` sh
257
260
{" cmd" :" remsym" ," arg" :" SYM6" }
258
261
` ` `
259
262
263
+ # #### f) CLIENT-APP connected request ping
264
+ {" cmd" :" cping" ," arg" :" " }
265
+ ` ` ` sh
266
+ {" cmd" :" cping" ," arg" :" " }
267
+ ` ` `
268
+ Get state if any Client-App is connected to the relay. Also, a ping-alive packet that wsrtd is connected to Relay server.
269
+
260
270
261
271
# ### 3.2) Response CMD "to WS_RTD" Plug-in from Server
262
272
263
- # #### a) General acknowledgement reponse
273
+ # #### a) General acknowledgement response
264
274
{" cmd" :" CMD_SENT" ," code" :int_code," arg" :" response string" }
265
275
Mandatory code field
266
276
` ` ` sh
267
277
{" cmd" :" remsym" ," code" :200," arg" :" SYM6 unsubscribed ok" } /* sucess example* /
268
278
{" cmd" :" addsym" ," code" :400," arg" :" XYZ9 subscribe error, invalid" } /* failure example* /
269
279
` ` `
270
280
281
+ # #### b) Ping acknowledgement response
282
+ Mandatory code field
283
+ ` ` ` sh
284
+ {" cmd" :" cping" ," code" :200," arg" :" Vendor Connected" } /* Client running & connected to remote* /
285
+ {" cmd" :" cping" ," code" :400," arg" :" Vendor Disconnected" } /* Client running but remote source is disconnected* /
286
+ ` ` `
287
+
271
288
272
289
# ### 3.3) Request CMD "to WS_RTD" Plug-in "from" Server
273
290
Mandatory code=300
@@ -305,12 +322,13 @@ returns {"ack":"dbgetbase","code":200,"arg"="60"}
305
322
{" cmd" :" dbstatus" ," code" :300," arg" :" " }
306
323
" arg" field required, can set empty
307
324
returns a STRING with Format as ( convert to INT )
308
- Current_Sym_Count, Max_Sym_Limit, Max_Size_Sym_Quotes, Refresh_Interval, Base_Interval
325
+ Current_Sym_Count, Max_Sym_Limit, Max_Size_Sym_Quotes, Refresh_Interval, Base_Interval, DB_Name
309
326
` ` ` sh
310
327
{" cmd" :" dbstatus" ," code" :300," arg" :" DB Status requested at 14:56:00" }
311
- returns {" ack" :" dbstatus" ," code" :200," arg" =" 500 1000 200 300 60" }
328
+ returns {" ack" :" dbstatus" ," code" :200," arg" =" 500 1000 200 300 60 Db_Test " }
312
329
` ` `
313
330
331
+
314
332
# ## 4) ACK format in json message
315
333
Plug-in will respond with ** Acknowledgement TO Server** for all code=300 Server-side REQUESTS with json-ACK " ack" with server-request, " arg" with description and " code" which is integer
316
334
Code values for OK=200, and OTHER/BAD=400
@@ -487,6 +505,21 @@ The status color will change to 🟢 from $${\color{ForestGreen}Dark \space
487
505
Kindly use DebugView to check if settings change requires an AB to be restarted or Plugin to be reconnect. Scroll up to Configure section and read the details.
488
506
489
507
508
+ ## AFL access functions
509
+ ### using GetExtraData()
510
+ https://www.amibroker.com/guide/afl/getextradata.html
511
+
512
+ #### 1) "IsRtdConn"
513
+ if Data plugin websocket is connected, 1 else 0
514
+
515
+ #### 2) "ClientAppStatus"
516
+ if Client App websocket is connected, Client App should implement "cping" cmd
517
+ ```sh
518
+ 0 = client-app not running
519
+ 200 = running
520
+ 400 = running but remote disconnected
521
+ -1 = ping sent, awaiting reply
522
+ ```
490
523
491
524
<here>
492
525
0 commit comments