Open gdaneluti opened 3 years ago
No. This is usually done by sending response type and other metadata in response message. Like this, for example:
if(response.type == "auth_ok")
{
subscribeOnDataFlow();
}
else if(response.type == "command_response")
{
val commandId = response.commandId
val commandHandler = handlers.get(commandId)
val handler.handle(response)
}
am I able to bind different listeners for each sendText method that I call?
For example: I have one call to authenticate my application: websocket.sendText("auth request")
I have another one to request some information: websocket.sendText("request some information").
I am receiving both responses in the same listener but I need to receive each one in a specific listener then I can handle each one differently.
Is that possible? I will leave peace of my code here: