[erlang-questions] gen_sctp multi-homing

Mikael Lixenstrand <>
Mon Jun 2 09:50:29 CEST 2008


Still haven't figured out what the problem might be. I try another time here

I tried this in the erlang shell with a running program with
gen_sctp:open([{ip, {10,80,250,112}},{ip, {10,70,128,96}} ,{port,33333}] ++
?sctp_options),

{ok, Socket} = gen_sctp:open([{ip, {10,30,40,50}}]).
{ok, Assoc1} =gen_sctp:connect(Socket,{10,80,250,112},33333,[], 6000).
{ok,{sctp_assoc_change,comm_up,0,10,10,1}}

{ok, Asso21} = gen_sctp:connect(Socket,{10,70,128,96},33333,[], 6000).

=ERROR REPORT==== 2-Jun-2008::08:52:19 ===
Error in process <0.38.0> on node '' with exit value:
{{badmatch,{error,eisconn}},[{erl_eval,expr,3}]}

** exited: {{badmatch,{error,eisconn}},[{erl_eval,expr,3}]} **

Someone have any idea what the problem might be?
I'm using R11B-5.

2008/5/29, Mikael Lixenstrand <>:
>
> I try this but get Error Reason: eisconn (The socket is already connected.)
>
> Could i have done anything else wrong?
>
> gen_sctp:open(lists:merge(IP,?sctp_client_options)) of
>     {ok, Socket} ->
>         AssocList = lists:foldl(fun(IP, AccList) ->
>             case gen_sctp:connect(Socket, IP, Port,[],
> ?sctp_connect_timeout) of
>                 {ok, Assoc} ->
>                     [Assoc | AccList];
>                 {error, Reason} ->
>                     AccList
>             end
>         end, [], IPList),
>
> thanks for the help
>
>
>
> 2008/5/29, Serge Aleynikov <>:
>>
>> You can call gen_sctp:connect/4 multiple times.  Note that this call
>> doesn't create new sockets but establishes a new association on a given
>> socket.
>>
>> Serge
>>
>> Mikael Lixenstrand wrote:
>>
>>> I have some questions regarding gen_sctp and multihoming. It´s possible
>>> to
>>> create a socket to multiple local peers but i haven't figured out how to
>>> connect a socket to multiple IPs on another host.
>>>
>>> Is this possible with gen_sctp or would i need to implement something
>>> using
>>> more sockets?
>>> I would like to have one socket with multiple associations, one for each
>>> peer on remote host.
>>>
>>> /mikael
>>>
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> erlang-questions mailing list
>>> 
>>> http://www.erlang.org/mailman/listinfo/erlang-questions
>>>
>>
>>
>
>
> --
> ****************************
>   Mikael Lixenstrand
>   Slättadammsgatan 9 a 12
>   417 27 Göteborg
>   mob   : 0707 593809
>   icq   :169264851
>   msn: 
> ****************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080602/0289aa62/attachment.html>


More information about the erlang-questions mailing list