Skip to content

Add Connection Status Listener. Add functions to Reconnect and Disconnect all subscriptions. #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 4, 2025

Conversation

KGronek-Pubnub
Copy link
Contributor

add(subscribe): Add Connection Status Listener, so user can react to connection errors.

add(subscribe): Add functions to Reconnect and Disconnect all subscriptions.

@KGronek-Pubnub KGronek-Pubnub self-assigned this May 30, 2025
Comment on lines 866 to 885
{
PubNub* PubnubObject = static_cast<PubNub*>(_data);
if(!PubnubObject || !PubnubObject->status_listener)
{
return;
}

//Don't call the listener if the subscription status is changed - this type is not supported in Chat SDK
if(status == PNSS_SUBSCRIPTION_STATUS_SUBSCRIPTION_CHANGED)
{
return;
}
else
{
Pubnub::ConnectionStatusData data;
data.reason = pubnub_res_2_string(status_data.reason);
PubnubObject->status_listener(PubNub::pn_subscription_status_to_connection_status(status), data);
}
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be a part of the CallbackService?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to CallbackService

Copy link
Contributor

@Xavrax Xavrax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - however that would be nice to format the codebase.

@jakub-grzesiowski jakub-grzesiowski merged commit 6a305b5 into master Jun 4, 2025
1 check passed
@jakub-grzesiowski jakub-grzesiowski deleted the CLEN-2780_Connection_Listener branch June 4, 2025 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants