Skip to content
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

Connectionmgr sync transport #344

Merged
merged 1 commit into from
Aug 13, 2017
Merged

Conversation

paddybyers
Copy link
Member

Fixes: #309

The ConnectionManager has a daemon thread which serialises and enacts all connection state changes and notifies listeners. However, there are events that arise from the transport (ie disconnections and errors) that are asynchronous relative to the ConnectionManager; and these can result in the transport being cleared. This means there are windows in which the connection state indicates that messages may be sent, but the transport is unavailable.

This change avoids the crashes that occur if there is an attempt to send a message when there is no transport. The messages can be silently discarded, just as if they were sent on a transport but never arrived at the destination. Higher layers (eg the protocol acknowledgements) will take care of the resulting errors/omissions.

@paddybyers paddybyers changed the base branch from master to close-whilst-connecting August 12, 2017 16:51
@paddybyers paddybyers changed the base branch from close-whilst-connecting to master August 13, 2017 01:22
@paddybyers paddybyers merged commit d2bb116 into master Aug 13, 2017
@paddybyers paddybyers deleted the connectionmgr-sync-transport branch August 13, 2017 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant