It will be difficult to write this question, especially in English, forgive me.
In an app I'm using a B4XPage that acts as connection (websocket) between client and server (in practice the page is as if it represented the websocket itself but also having a minimum of GUI to show the "connection animation" and a couple of dialogs in in case of no Internet connection or server unreachable. All the project has a very bad design - and this is just the starting point - that is also driving me crazy; but no one helps me, I feel so alone ?)
? I must try to synthesize as much as possible.
PageX uses that "WS page" to connect. In "WS page" I have:
(you know this code, Erel).
In PageX I set that "WS page"'s mCallback to Me (WS page has a property...!)
Well, if I write a sub in PageX "called" by the server, like:
it is "reached" by the CallSub2 above; instead if I write, still in PageX:
it is not.
If I explained too badly... I will try to develop a small project, without websocket, and I will attach it.
EDIT: what a Log(mCallback) shows! Just to know/check what the current callback object is!.
In an app I'm using a B4XPage that acts as connection (websocket) between client and server (in practice the page is as if it represented the websocket itself but also having a minimum of GUI to show the "connection animation" and a couple of dialogs in in case of no Internet connection or server unreachable. All the project has a very bad design - and this is just the starting point - that is also driving me crazy; but no one helps me, I feel so alone ?)
? I must try to synthesize as much as possible.
PageX uses that "WS page" to connect. In "WS page" I have:
B4X:
'...
If etype = "runFunction" Then
CallSub2(mCallback, mEventName & "_" & event, mapParams)
End If
'...
In PageX I set that "WS page"'s mCallback to Me (WS page has a property...!)
Well, if I write a sub in PageX "called" by the server, like:
B4X:
Sub MyRoutine(params As map)
'...
B4X:
Wait For MyRoutine(params As map)
If I explained too badly... I will try to develop a small project, without websocket, and I will attach it.
EDIT: what a Log(mCallback) shows! Just to know/check what the current callback object is!.
Last edited: