ExCEP. Cluster. Session
(ex_cep v0.1.1)
Copy Markdown
Per-gateway TCP/TLS connection session on the Cluster (Master) server.
Executes the server side of Section 5 three-way SM2 authentication, registers the
authenticated gateway_id with ExCEP.Cluster.Server, correlates Cluster -> Gateway
requests by Head/Mid, and dispatches Gateway -> Cluster reports to ExCEP.Cluster.Handler.
Summary
Functions
Returns a specification to start this module under a supervisor.
Closes the session (idempotent if already stopped).
Pulls a file from the Gateway using Section 6.2.1 FileGet + FileDataTrans.
Sends a %DataAsdu{} request from the Cluster to this Gateway and awaits its response.
Sends a %DataAsdu{} from the Cluster to this Gateway without waiting for a response.
Starts an unlinked session process (used by ExCEP.Cluster.Server for fault isolation).
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec close(pid()) :: :ok
Closes the session (idempotent if already stopped).
Pulls a file from the Gateway using Section 6.2.1 FileGet + FileDataTrans.
@spec request(pid(), ExCEP.Codec.DataAsdu.t(), keyword()) :: {:ok, ExCEP.Codec.DataAsdu.t()} | {:error, term()}
Sends a %DataAsdu{} request from the Cluster to this Gateway and awaits its response.
@spec send_asdu(pid(), ExCEP.Codec.DataAsdu.t(), keyword()) :: :ok | {:error, term()}
Sends a %DataAsdu{} from the Cluster to this Gateway without waiting for a response.
@spec start(keyword()) :: GenServer.on_start()
Starts an unlinked session process (used by ExCEP.Cluster.Server for fault isolation).
@spec start_link(keyword()) :: GenServer.on_start()