Module sipsocket_tcp

TCP/TLS sipsocket module.

Introduced in: 15 Dec 2003 by Fredrik Thulin <ft@it.su.se>

Behaviours: sipsocket.

Authors: Fredrik Thulin (ft@it.su.se).

Description

TCP/TLS sipsocket module. Interface module to the tcp_dispatcher gen_server process that shepherds all TCP/TLS connection handler processes.

Data Types

tcp_proto()

tcp_proto() = tcp | tcp6 | tls | tls6

Transport layer TCP/TLS protocol.

Function Index

close_socket/1 Close a socket.
get_raw_socket/1 Get the raw TCP/UDP/TLS socket from the socket handler.
get_remote_peer/1 Get the remote IP and port of a specific socket.
get_socket/1 Get a socket, cached or new, useable to send messages to this destination.
get_specific_socket/1 Return a specific socket.
is_reliable_transport/1 Return true.
send/5 Send a SIP message.
start_link/0

Function Details

close_socket/1

close_socket(Sipsocket::SipSocket) -> ok | {error, Reason}

Close a socket.

get_raw_socket/1

get_raw_socket(SipSocket::Socket) -> {ok, RawSocket} | {error, Reason}

Get the raw TCP/UDP/TLS socket from the socket handler. Be careful with what you do with the raw socket - don't use it for sending/receiving for example. Intended for use in extractin certificate information of an SSL socket or similar.

get_remote_peer/1

get_remote_peer(Id) -> {ok, Proto, IP, Port} | {error, Reason}

Get the remote IP and port of a specific socket.

get_socket/1

get_socket(Sipdst::Dst) -> SipSocket | {error, Reason}

Get a socket, cached or new, useable to send messages to this destination.

get_specific_socket/1

get_specific_socket(Ob_id::Id) -> SipSocket | {error, Reason}

Return a specific socket. Used by draft-Outbound implem- entation to send requests using an existing flow, or not at all.

is_reliable_transport/1

is_reliable_transport(Sipsocket::_SipSocket) -> true

Return true. This sipsocket modules transports are reliable. The meaning of reliable is that they handle resends automatically, so the transaction layer does not have to set up timers to resend messages.

send/5

send(Sipsocket::SipSocket, Proto, Host, Port, Message) -> SendRes | {error, Reason} | term()

Send a SIP message. Get the tcp_connection process from the sipsocket, and request it to send the message. Returns whatever the socket module (gen_tcp or ssl) send- function returns. Typically 'ok' or {error, Something}.

start_link/0

start_link() -> term()


Generated by EDoc, Oct 17 2007, 16:48:21.