Mod:start({Type, Ref}, Svc, Config) -> {ok, Pid} | {ok, Pid, LAddrs} | {error, Reason}
OTP R14B03
Types
Start a transport process. Called by diameter as a consequence of a call to diameter:add_transport/2
in order to establish or accept a transport connection respectively. A transport process maintains a connection with a single remote peer.
Type
indicates whether the transport process in question is being started for a connecting (Type=connect
) or listening (Type=accept
) transport. In the latter case, transport processes are started as required to accept connections from multiple peers.
Ref is the value that was returned from the call to diameter:add_transport/2
that has lead to starting of a transport process.
Svc
contains capabilities passed to diameter:start_service/2
and diameter:add_transport/2
, values passed to the latter overriding those passed to the former.
Config
is as passed in transport_config
tuple in the diameter:transport_opt()
list passed to diameter:add_transport/2
.
The start function should use the Host-IP-Address
list in Svc
and/or Config
to select and return an appropriate list of local IP addresses. In the connecting case, the local address list can instead be communicated in a connected
message (see MESSAGES
below) following connection establishment. In either case, the local address list is used to populate Host-IP-Address
AVPs in outgoing capabilities exchange messages if Host-IP-Address
is unspecified.
A transport process must implement the message interface documented below. It should retain the pid of its parent, monitor the parent and terminate if it dies. It should not link to the parent. It should exit if its transport connection with its peer is lost.