diff options
author | Raimo Niskanen <[email protected]> | 2010-08-25 18:03:09 +0200 |
---|---|---|
committer | Raimo Niskanen <[email protected]> | 2010-08-31 16:15:49 +0200 |
commit | eaf1d4c5850ee84427d70e3df42fe777d82249c2 (patch) | |
tree | cc668454d7fa9aa450c1451111a8921e068b79fe /lib/kernel/src/inet6_sctp.erl | |
parent | eca2411eb67461bf3cda66d0f981b47698ab99f3 (diff) | |
download | otp-eaf1d4c5850ee84427d70e3df42fe777d82249c2.tar.gz otp-eaf1d4c5850ee84427d70e3df42fe777d82249c2.tar.bz2 otp-eaf1d4c5850ee84427d70e3df42fe777d82249c2.zip |
Keep default #sctp_sndrcvinfo{} fields on gen_sctp:send/4
Diffstat (limited to 'lib/kernel/src/inet6_sctp.erl')
-rw-r--r-- | lib/kernel/src/inet6_sctp.erl | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/lib/kernel/src/inet6_sctp.erl b/lib/kernel/src/inet6_sctp.erl index 5c49c4fec3..6534af7c52 100644 --- a/lib/kernel/src/inet6_sctp.erl +++ b/lib/kernel/src/inet6_sctp.erl @@ -32,7 +32,7 @@ -define(FAMILY, inet6). -export([getserv/1,getaddr/1,getaddr/2,translate_ip/1]). --export([open/1,close/1,listen/2,connect/5,sendmsg/3,recv/2]). +-export([open/1,close/1,listen/2,connect/5,sendmsg/3,send/4,recv/2]). @@ -71,5 +71,24 @@ connect(S, Addr, Port, Opts, Timer) -> sendmsg(S, SRI, Data) -> prim_inet:sendmsg(S, SRI, Data). +send(S, AssocId, Stream, Data) -> + case prim_inet:getopts( + S, + [{sctp_default_send_param,#sctp_sndrcvinfo{assoc_id=AssocId}}]) of + {ok, + [{sctp_default_send_param, + #sctp_sndrcvinfo{ + flags=Flags, context=Context, ppid=PPID, timetolive=TTL}}]} -> + prim_inet:sendmsg( + S, + #sctp_sndrcvinfo{ + flags=Flags, context=Context, ppid=PPID, timetolive=TTL, + assoc_id=AssocId, stream=Stream}, + Data); + _ -> + prim_inet:sendmsg( + S, #sctp_sndrcvinfo{assoc_id=AssocId, stream=Stream}, Data) + end. + recv(S, Timeout) -> prim_inet:recvfrom(S, 0, Timeout). |