<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" href="../../../../doc/otp_doc.css" type="text/css"> <title>Erlang -- diameter_tcp(3)</title> </head> <body bgcolor="white" text="#000000" link="#0000ff" vlink="#ff00ff" alink="#ff0000"><div id="container"> <script id="js" type="text/javascript" language="JavaScript" src="../../../../doc/js/flipmenu/flipmenu.js"></script><script id="js2" type="text/javascript" src="../../../../doc/js/erlresolvelinks.js"></script><script language="JavaScript" type="text/javascript"> <!-- function getWinHeight() { var myHeight = 0; if( typeof( window.innerHeight ) == 'number' ) { //Non-IE myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myHeight = document.body.clientHeight; } return myHeight; } function setscrollpos() { var objf=document.getElementById('loadscrollpos'); document.getElementById("leftnav").scrollTop = objf.offsetTop - getWinHeight()/2; } function addEvent(obj, evType, fn){ if (obj.addEventListener){ obj.addEventListener(evType, fn, true); return true; } else if (obj.attachEvent){ var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } } addEvent(window, 'load', setscrollpos); //--></script><div id="leftnav"><div class="innertube"> <img alt="Erlang logo" src="../../../../doc/erlang-logo.png"><br><small><a href="users_guide.html">User's Guide</a><br><a href="index.html">Reference Manual</a><br><a href="release_notes.html">Release Notes</a><br><a href="../pdf/diameter-1.11.2.pdf">PDF</a><br><a href="../../../../doc/index.html">Top</a></small><p><strong>Diameter</strong><br><strong>Reference Manual</strong><br><small>Version 1.11.2</small></p> <br><a href="javascript:openAllFlips()">Expand All</a><br><a href="javascript:closeAllFlips()">Contract All</a><p><small><strong>Table of Contents</strong></small></p> <ul class="flipMenu"> <li id="no" title="diameter " expanded="false">diameter<ul> <li><a href="diameter.html"> Top of manual page </a></li> <li title="add_transport-2"><a href="diameter.html#add_transport-2">add_transport/2</a></li> <li title="call-4"><a href="diameter.html#call-4">call/4</a></li> <li title="origin_state_id-0"><a href="diameter.html#origin_state_id-0">origin_state_id/0</a></li> <li title="remove_transport-2"><a href="diameter.html#remove_transport-2">remove_transport/2</a></li> <li title="service_info-2"><a href="diameter.html#service_info-2">service_info/2</a></li> <li title="services-0"><a href="diameter.html#services-0">services/0</a></li> <li title="session_id-1"><a href="diameter.html#session_id-1">session_id/1</a></li> <li title="start-0"><a href="diameter.html#start-0">start/0</a></li> <li title="start_service-2"><a href="diameter.html#start_service-2">start_service/2</a></li> <li title="stop-0"><a href="diameter.html#stop-0">stop/0</a></li> <li title="stop_service-1"><a href="diameter.html#stop_service-1">stop_service/1</a></li> <li title="subscribe-1"><a href="diameter.html#subscribe-1">subscribe/1</a></li> <li title="unsubscribe-1"><a href="diameter.html#unsubscribe-1">unsubscribe/1</a></li> </ul> </li> <li title="diameterc"><a href="diameterc.html">diameterc</a></li> <li id="no" title="diameter_app " expanded="false">diameter_app<ul> <li><a href="diameter_app.html"> Top of manual page </a></li> <li title="Mod:peer_up-3"><a href="diameter_app.html#Mod:peer_up-3">Mod:peer_up/3</a></li> <li title="Mod:peer_down-3"><a href="diameter_app.html#Mod:peer_down-3">Mod:peer_down/3</a></li> <li title="Mod:pick_peer-4"><a href="diameter_app.html#Mod:pick_peer-4">Mod:pick_peer/4</a></li> <li title="Mod:prepare_request-3"><a href="diameter_app.html#Mod:prepare_request-3">Mod:prepare_request/3</a></li> <li title="Mod:prepare_retransmit-3"><a href="diameter_app.html#Mod:prepare_retransmit-3">Mod:prepare_retransmit/3</a></li> <li title="Mod:handle_answer-4"><a href="diameter_app.html#Mod:handle_answer-4">Mod:handle_answer/4</a></li> <li title="Mod:handle_error-4"><a href="diameter_app.html#Mod:handle_error-4">Mod:handle_error/4</a></li> <li title="Mod:handle_request-3"><a href="diameter_app.html#Mod:handle_request-3">Mod:handle_request/3</a></li> </ul> </li> <li id="no" title="diameter_codec " expanded="false">diameter_codec<ul> <li><a href="diameter_codec.html"> Top of manual page </a></li> <li title="decode-2"><a href="diameter_codec.html#decode-2">decode/2</a></li> <li title="encode-2"><a href="diameter_codec.html#encode-2">encode/2</a></li> </ul> </li> <li title="diameter_dict"><a href="diameter_dict.html">diameter_dict</a></li> <li id="no" title="diameter_make " expanded="false">diameter_make<ul> <li><a href="diameter_make.html"> Top of manual page </a></li> <li title="codec-2"><a href="diameter_make.html#codec-2">codec/2</a></li> <li title="format-1"><a href="diameter_make.html#format-1">format/1</a></li> <li title="flatten-1"><a href="diameter_make.html#flatten-1">flatten/1</a></li> <li title="format_error-1"><a href="diameter_make.html#format_error-1">format_error/1</a></li> </ul> </li> <li id="no" title="diameter_transport " expanded="false">diameter_transport<ul> <li><a href="diameter_transport.html"> Top of manual page </a></li> <li title="Mod:start-3"><a href="diameter_transport.html#Mod:start-3">Mod:start/3</a></li> </ul> </li> <li id="loadscrollpos" title="diameter_tcp " expanded="true">diameter_tcp<ul> <li><a href="diameter_tcp.html"> Top of manual page </a></li> <li title="start-3"><a href="diameter_tcp.html#start-3">start/3</a></li> </ul> </li> <li id="no" title="diameter_sctp " expanded="false">diameter_sctp<ul> <li><a href="diameter_sctp.html"> Top of manual page </a></li> <li title="start-3"><a href="diameter_sctp.html#start-3">start/3</a></li> </ul> </li> </ul> </div></div> <div id="content"> <div class="innertube"> <!-- refpage --><center><h1>diameter_tcp</h1></center> <h3>MODULE</h3> <div class="REFBODY">diameter_tcp</div> <h3>MODULE SUMMARY</h3> <div class="REFBODY">Diameter transport over TCP.</div> <h3>DESCRIPTION</h3> <div class="REFBODY"><p> <p> This module implements diameter transport over TCP using <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','kernel','gen_tcp.html');">gen_tcp(3)</a></span>. It can be specified as the value of a <span class="code">transport_module</span> option to <span class="bold_code"><a href="diameter.html#add_transport-2">diameter:add_transport/2</a></span> and implements the behaviour documented in <span class="bold_code"><a href="diameter_transport.html">diameter_transport(3)</a></span>. TLS security is supported, either as an upgrade following capabilities exchange or at connection establishment.</p> <p> Note that the ssl application is required for TLS and must be started before configuring TLS capability on diameter transports.</p> <a name="start"></a> </p></div> <h3>EXPORTS</h3> <p><a name="start-3"><span class="bold_code">start({Type, Ref}, Svc, [Opt]) -> {ok, Pid} | {ok, Pid, [LAddr]} | {error, Reason}</span></a><br></p> <div class="REFBODY"> <p>Types:</p> <div class="REFTYPES"> <span class="bold_code">Type = connect | accept</span><br> </div> <div class="REFTYPES"> <span class="bold_code">Ref = <span class="bold_code"><a href="diameter.html#transport_ref">diameter:transport_ref()</a></span></span><br> </div> <div class="REFTYPES"> <span class="bold_code">Svc = #diameter_service{}</span><br> </div> <div class="REFTYPES"> <span class="bold_code">Opt = OwnOpt | SslOpt | TcpOpt</span><br> </div> <div class="REFTYPES"> <span class="bold_code">Pid = pid()</span><br> </div> <div class="REFTYPES"> <span class="bold_code">LAddr = <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','kernel','inet.html#type-ip_address');">inet:ip_address()</a></span></span><br> </div> <div class="REFTYPES"> <span class="bold_code">Reason = term()</span><br> </div> <div class="REFTYPES"> <span class="bold_code">OwnOpt = {raddr, <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','kernel','inet.html#type-ip_address');">inet:ip_address()</a></span>} | {rport, integer()} | {accept, Match} | {port, integer()} | {fragment_timer, infinity | 0..16#FFFFFFFF}</span><br> </div> <div class="REFTYPES"> <span class="bold_code">SslOpt = {ssl_options, true | list()}</span><br> </div> <div class="REFTYPES"> <span class="bold_code">TcpOpt = term()</span><br> </div> <div class="REFTYPES"> <span class="bold_code">Match = <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','kernel','inet.html#type-ip_address');">inet:ip_address()</a></span> | string() | [Match]</span><br> </div> </div> <div class="REFBODY"><p> <p> The start function required by <span class="bold_code"><a href="diameter_transport.html">diameter_transport(3)</a></span>.</p> <p> Options <span class="code">raddr</span> and <span class="code">rport</span> specify the remote address and port for a connecting transport and are not valid for a listening transport.</p> <p> Option <span class="code">accept</span> specifies remote addresses for a listening transport and is not valid for a connecting transport. If specified, a remote address that does not match one of the specified addresses causes the connection to be aborted. Multiple <span class="code">accept</span> options can be specified. A string-valued <span class="code">Match</span> that does not parse as an address is interpreted as a regular expression.</p> <p> Option <span class="code">ssl_options</span> must be specified for a transport that should support TLS: a value of <span class="code">true</span> results in a TLS handshake immediately upon connection establishment while <span class="code">list()</span> specifies options to be passed to <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','ssl','ssl.html#connect-2');">ssl:connect/2</a></span> or <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','ssl','ssl.html#ssl_accept-2');">ssl:ssl_accept/2</a></span> after capabilities exchange if TLS is negotiated.</p> <p> Option <span class="code">fragment_timer</span> specifies the timeout, in milliseconds, of a timer used to flush messages from the incoming byte stream even if the number of bytes indicated in the Message Length field of its Diameter Header have not yet been accumulated: such a message is received over the transport interface after two successive timeouts without the reception of additional bytes. Defaults to 1000.</p> <p> Remaining options are any accepted by <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','ssl','ssl.html#connect-3');">ssl:connect/3</a></span> or <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','kernel','gen_tcp.html#connect-3');">gen_tcp:connect/3</a></span> for a connecting transport, or <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','ssl','ssl.html#listen-2');">ssl:listen/2</a></span> or <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','kernel','gen_tcp.html#listen-2');">gen_tcp:listen/2</a></span> for a listening transport, depending on whether or not <span class="code">{ssl_options, true}</span> has been specified. Options <span class="code">binary</span>, <span class="code">packet</span> and <span class="code">active</span> cannot be specified. Also, option <span class="code">port</span> can be specified for a listening transport to specify the local listening port, the default being the standardized 3868 if unspecified. Note that the option <span class="code">ip</span> specifies the local address.</p> <p> An <span class="code">ssl_options</span> list must be specified if and only if the transport in question has set <span class="code">Inband-Security-Id</span> to 1 (<span class="code">TLS</span>), as specified to either <span class="bold_code"><a href="diameter.html#start_service-2">diameter:start_service/2</a></span> or <span class="bold_code"><a href="diameter.html#add_transport-2">diameter:add_transport/2</a></span>, so that the transport process will receive notification of whether or not to commence with a TLS handshake following capabilities exchange. Failing to specify an options list on a TLS-capable transport for which TLS is negotiated will cause TLS handshake to fail. Failing to specify TLS capability when <span class="code">ssl_options</span> has been specified will cause the transport process to wait for a notification that will not be forthcoming, which will eventually cause the RFC 3539 watchdog to take down the connection.</p> <p> If an <span class="code">ip</span> option is not specified then the first element of a non-empty <span class="code">Host-IP-Address</span> list in <span class="code">Svc</span> provides the local IP address. If neither is specified then the default address selected by <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','kernel','gen_tcp.html');">gen_tcp(3)</a></span> is used. In all cases, the selected address is either returned from <span class="bold_code"><a href="#start-3">start/3</a></span> or passed in a <span class="code">connected</span> message over the transport interface.</p> </p></div> <h3><a name="idp304538580">SEE ALSO</a></h3> <div class="REFBODY"> <p> <span class="bold_code"><a href="diameter.html">diameter(3)</a></span>, <span class="bold_code"><a href="diameter_transport.html">diameter_transport(3)</a></span>, <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','kernel','gen_tcp.html');">gen_tcp(3)</a></span>, <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','kernel','inet.html');">inet(3)</a></span>, <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','ssl','ssl.html');">ssl(3)</a></span></p> </div> </div> <div class="footer"> <hr> <p>Copyright © 2011-2018 Ericsson AB. All Rights Reserved.</p> </div> </div> </div></body> </html>