(ixcobra) add explicit event types for handshake, authentication and subscription failure, and handle those by exiting in ws_cobra_subcribe and friends

This commit is contained in:
Benjamin Sergeant
2020-03-26 18:54:28 -07:00
parent 09e4584fc8
commit d2db7310ff
7 changed files with 103 additions and 23 deletions

View File

@ -166,7 +166,8 @@ namespace ix
}
else if (action == "auth/handshake/error")
{
invokeErrorCallback("Handshake error", msg->str);
invokeEventCallback(ix::CobraConnection_EventType_Handshake_Error,
msg->str);
}
else if (action == "auth/authenticate/ok")
{
@ -176,7 +177,8 @@ namespace ix
}
else if (action == "auth/authenticate/error")
{
invokeErrorCallback("Authentication error", msg->str);
invokeEventCallback(ix::CobraConnection_EventType_Authentication_Error,
msg->str);
}
else if (action == "rtm/subscription/data")
{
@ -191,7 +193,8 @@ namespace ix
}
else if (action == "rtm/subscribe/error")
{
invokeErrorCallback("Subscription error", msg->str);
invokeEventCallback(ix::CobraConnection_EventType_Subscription_Error,
msg->str);
}
else if (action == "rtm/unsubscribe/ok")
{

View File

@ -37,7 +37,10 @@ namespace ix
CobraConnection_EventType_Subscribed = 4,
CobraConnection_EventType_UnSubscribed = 5,
CobraConnection_EventType_Published = 6,
CobraConnection_EventType_Pong = 7
CobraConnection_EventType_Pong = 7,
CobraConnection_EventType_Handshake_Error = 8,
CobraConnection_EventType_Authentication_Error = 9,
CobraConnection_EventType_Subscription_Error = 10
};
enum CobraConnectionPublishMode