[erlang-questions] Re: SCTP accept?

Serge Aleynikov saleyn@REDACTED
Tue Nov 10 17:09:46 CET 2009


On the contrary to TCP where a client socket corresponds to a single 
communication channel to be used between the server/client pair, with 
SCTP (when using one-to-many style interface, which is what's currently 
supported in the SCTP driver) you have one SCTP socket to work with and 
one association per client end-point.

You can send replies from more than one Erlang server-side worker 
process as long as you pass it the Socket::sctp_socket() and 
AssocID::assoc_id() (the AssocID comes in the #sctp_assoc_change{} event 
when a new client association is established).  Then you can use 
gen_sctp:send/3 or gen_sctp:send/4 functions to send your HTTP payload.

Serge

Steve Davis wrote:
> I must be incredibly dense! Many words later, I'm still 100% unclear
> as to how to use gen_sctp effectively to do "http over sctp".
> 
> The documentation shows an
> "Example of an Erlang SCTP Server which receives SCTP messages and
> prints them on the standard output."
> ...but does not really address how you reply unless you do everything
> from the one server process.
> 
> To have any chance of scaling I would think that you'd want to process
> client requests in a number of worker processes at the server side
> (obviously)?
> 
> With tcp you hand over the socket you get from accept -- but I'm
> entirely unclear what the equivalent of controlling_process(Socket,
> Pid) would be for associations?
> 
> Any education would be very gratefully "accepted"!
> 
> Best,
> Steve
> 
> ________________________________________________________________
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org
> 


More information about the erlang-questions mailing list