Ranch listener lifecycle management.
Wraps :ranch.child_spec/5 to start a TCP listener that accepts DICOM
associations. Each accepted connection is handed off to
Dimse.ConnectionHandler, which spawns a Dimse.Association GenServer.
Usage
Add to your supervision tree:
children = [
{Dimse.Listener, port: 11112, handler: MyApp.DicomHandler}
]
Supervisor.start_link(children, strategy: :one_for_one)Or start dynamically:
{:ok, ref} = Dimse.start_listener(port: 11112, handler: MyApp.DicomHandler)Options
See Dimse.start_listener/1 for available options.
Summary
Functions
Returns a child spec for the Ranch listener.
Starts a DIMSE listener.
Stops a running listener.
Functions
@spec child_spec(keyword()) :: Supervisor.child_spec()
Returns a child spec for the Ranch listener.
Used when adding the listener to a supervision tree.
Starts a DIMSE listener.
Returns {:ok, listener_ref} on success.
Options
:port— TCP port (default:11112):handler— module implementingDimse.Handler(required):ae_title— local AE title (default:"DIMSE"):max_associations— max concurrent associations (default:200):num_acceptors— Ranch acceptor pool size (default:10):max_pdu_length— max PDU length in bytes (default:16_384):ref— custom listener reference (default: auto-generated):tls— TLS options (keyword list). When present, the listener uses TLS (ranch_ssl) instead of plain TCP. Accepts standard:ssloptions::certfile— path to the server certificate PEM file (required):keyfile— path to the server private key PEM file (required):cacertfile— path to CA certificate for client verification:verify—:verify_peerto require client certificates:fail_if_no_peer_cert—trueto reject clients without certs PS3.15 Annex B recommends port 2762 for DICOM-TLS.
@spec stop(term()) :: :ok
Stops a running listener.