Erlang -- diameter_tcp(3)

User's Guide
Reference Manual
Release Notes
PDF
Top

Diameter
Reference Manual
Version 0.10

Expand All
Contract All

Table of Contents

- diameter
  - Top of manual page
  - add_transport/2
  - call/4
  - origin_state_id/0
  - remove_transport/2
  - service_info/2
  - services/0
  - session_id/1
  - start/0
  - start_service/2
  - stop/0
  - stop_service/1
  - subscribe/1
  - unsubscribe/1
- diameterc
- diameter_app
  - Top of manual page
  - Mod:peer_up/3
  - Mod:peer_down/3
  - Mod:pick_peer/4
  - Mod:prepare_request/3
  - Mod:prepare_retransmit/3
  - Mod:handle_answer/4
  - Mod:handle_error/4
  - Mod:handle_request/3
- diameter_dict
- diameter_transport
  - Top of manual page
  - Mod:start/3
- diameter_tcp
  - Top of manual page
  - start/3
- diameter_sctp
  - Top of manual page
  - start/3

# diameter_tcp

### MODULE

diameter_tcp

### MODULE SUMMARY

Diameter transport over TCP.

### DESCRIPTION

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).

### EXPORTS

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

Types:

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 connecting transport and not valid for a listening transport. Remaining options are any accepted by gen_tcp:connect/3 for a connecting transport, or gen_tcp:listen/2 for a listening transport, with the exception of binary, packet and active. Also, option port can be specified for a listening transport 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.

### SEE ALSO

diameter_transport(3)