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

reconnect after unbind and disconnect #212

Merged
merged 2 commits into from
Sep 14, 2020
Merged

reconnect after unbind and disconnect #212

merged 2 commits into from
Sep 14, 2020

Conversation

theLastOfCats
Copy link
Contributor

Thank you for contributing to naz.
Every contribution to naz is important.

Contributions are under the MIT License.

Answer the following questions,

What(What have you changed?)

  • Added reconnect after unbind_and_disconnect in recieve_data lifecycle

Why(Why did you change it?)

References:

@codecov-commenter
Copy link

codecov-commenter commented Sep 11, 2020

Codecov Report

Merging #212 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #212   +/-   ##
=======================================
  Coverage   84.61%   84.62%           
=======================================
  Files          15       15           
  Lines        1566     1567    +1     
=======================================
+ Hits         1325     1326    +1     
  Misses        241      241           
Impacted Files Coverage Δ
naz/client.py 81.05% <100.00%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e00567c...3a97834. Read the comment docs.

Comment on lines +1783 to +1784
await self.re_establish_conn_bind(smpp_command="", log_id="")

Copy link
Owner

Choose a reason for hiding this comment

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

@theLastOfCats can I suggest that instead of this change.

You add a new line after;

naz/naz/client.py

Line 2362 in 3a97834

self.writer = None
with

self.current_session_state = SmppSessionState.CLOSED

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I'll choose this path, test which introduced in #208 will break.

To fix this flow, we'll need to move the reconnection phase in send_data.
Specifically this part https://github.com/komuw/naz/blob/master/naz/client.py#L1471

Or we reconnect after unbind as in PR.

@komuw komuw merged commit 5ccc848 into komuw:master Sep 14, 2020
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.

Set connection state to CLOSED after unbind_and_disconnect
3 participants