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

[MRG] Check socket still exists before sending data #724

Merged
merged 4 commits into from
Dec 26, 2021

Conversation

scaramallion
Copy link
Member

@scaramallion scaramallion commented Dec 26, 2021

Reference issue

Tasks

  • Unit tests added that reproduce issue or prove feature is working
  • Fix or feature added
  • Documentation and examples updated (if relevant)
  • Unit tests passing and coverage at 100% after adding fix/feature
  • Type annotations updated and passing with mypy

@codecov
Copy link

codecov bot commented Dec 26, 2021

Codecov Report

Merging #724 (28fcada) into master (f871c3b) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #724   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           28        28           
  Lines         8647      8642    -5     
=========================================
- Hits          8647      8642    -5     
Impacted Files Coverage Δ
pynetdicom/_config.py 100.00% <ø> (ø)
pynetdicom/transport.py 100.00% <ø> (ø)
pynetdicom/dul.py 100.00% <100.00%> (ø)

@scaramallion scaramallion changed the title [WIP] Check socket still exists before sending data [MRG] Check socket still exists before sending data Dec 26, 2021
@scaramallion scaramallion merged commit 7a0c87b into pydicom:master Dec 26, 2021
@scaramallion scaramallion deleted the fix-538 branch December 26, 2021 22:53
sock = cast("AssociationSocket", self.socket)
sock.send(pdu.encode())
evt.trigger(self.assoc, evt.EVT_PDU_SENT, {"pdu": pdu})
if self.socket is not None:
Copy link

Choose a reason for hiding this comment

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

what if self.socket.socket is None? shouldn't there be an if statement for that just in case? i think it might be the solution for this issue #806

Copy link
Member Author

Choose a reason for hiding this comment

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

Ideally the state machine and reactors should manage things so it never tries to send data while None

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.

bug report: state machine exception
2 participants