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

Endless loop when a socket is closed without release #39

Open
cguebert opened this issue Sep 21, 2016 · 3 comments
Open

Endless loop when a socket is closed without release #39

cguebert opened this issue Sep 21, 2016 · 3 comments

Comments

@cguebert
Copy link
Contributor

If a socket is closed on the other end without first sending an association release, my server is locked in a loop of :
Operation error: End of file
TCP timer started with pending operations
TCP time out
As I continue to try dispatching messages.
We should detect this case and at least send an exception similar to AssociationAborted.

@lamyj
Copy link
Owner

lamyj commented Oct 12, 2016

As you mentioned in 514c8b6, that part of Odil is clearly not robust enough; I'll have to delve in ASIO documentation to adapt the current design. I'm not yet sure how to reconcile the OSI/state machine view of DICOM with the event-based design of Boost.asio, so any suggestion is welcome 😄

By the way, sorry for the long delay in my answer: between vacations and being swamped in other projects, I haven't been able to work on Odil as much as I wanted to. Things should however be back to normal now.

@cguebert
Copy link
Contributor Author

I think I am going to look into the network aspect of Odil in the near future.
We can talk about it again in a few weeks, I will have read some ASIO documentation then.

@lamyj
Copy link
Owner

lamyj commented Oct 20, 2016

That would be great news! For future discussions, here are a few notes I took on this subject.

Impossibility to use one of Boost's state machine classes (Meta State Machine or State Chart): the DICOM one is too large and would need to change the hard-coded default values and recompile Boost. This won't play nice with the various packaging system, so I didn't go this way.

The state machine formalism (with a separation between states, transitions, and actions) is not perfect (at least when using ASIO) since a transition may occur in another transition: for example sending a PDU when the remote side has closed the socket will trigger an error transition from inside the sending-PDU transition. I think dropping the state/transition/action table and hard-coding the transitions in the actions would simplify the code.

The TCP/IP layer and the DUL layer must be more independent: not only is the error propagation of errors from TCP to DUL a bit of a mess, but the current design makes it impossible to fork just after receiving a TCP connection and thus hampers the usual implementation of a multi-threaded server (not sure how this applies on Windows).

There is a mechanism in ASIO to display the asynchronous operations as they are called: http://www.boost.org/doc/libs/1_62_0/doc/html/boost_asio/overview/core/handler_tracking.html

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

No branches or pull requests

2 participants