Diameter transport over TCP.

This module implements diameter transport over TCP using gen_tcp. It can be specified as the value of a transport_module option to diameter:add_transport/2 and implements the behaviour documented in diameter_transport(3).


start({Type, Ref}, Svc, [Opt]) -> {ok, Pid, [LAddr]} | {error, Reason}

  • Type = connect | accept
  • Ref = reference()
  • Svc = #diameter_service{}
  • Opt = {raddr, ip_address()} | {rport, integer()} | term()
  • Pid = pid()
  • LAddr = ip_address()
  • Reason = term()

The start function required by diameter_transport(3).

The only diameter_tcp-specific argument is the options list. Options raddr and rport specify the remote address and port for a connector and not valid for a listener. Remaining options are any accepted by gen_tcp:connect/3 for a connector, or gen_tcp:listen/2 for a listener, with the exception of binary, packet and active. Also, option port can be specified for a listener to specify the local listening port, the default being the standardized 3868 if unspecified. Note that option ip specifies the local address.

If the service specifies more than one Host-IP-Address and option ip is unspecified then then the first of the service's addresses is used as the local address.

The returned local address list has length one.

View Functions