SCRC v0.2.0 Scrc.Server View Source
Server implements boilerplate code for implementing an SCRC Server.
It forwards the domain specific calls to it’s simulation
.
Link to this section Summary
Types
Endpoint consists of a hostname (or IP) and port combination
A hostname or IP Address
A TCP Port number (0-65535)
Functions
Returns a specification to start this module under a supervisor
Initialize the server with the given simulation
. Listen on port
Send identified payload to client
Send restart payload to client
Send sensor payload to client
Send shutdown payload to client
Link to this section Types
Endpoint consists of a hostname (or IP) and port combination.
A hostname or IP Address.
A TCP Port number (0-65535)
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
init(%{simulation: pid(), port: endpoint_port()}) :: {:ok, %{simulation: pid(), socket: any(), endpoint: endpoint()}}
Initialize the server with the given simulation
. Listen on port
.
Send identified payload to client.
Send restart payload to client.
send_sensor_data(pid(), Scrc.SensorData.t()) :: :ok
Send sensor payload to client.
Send shutdown payload to client.