[SPAM] Re: TLS over SCTP

Nikos Mavrogiannopoulos nmav at gnutls.org
Sat Aug 9 11:37:20 CEST 2008


Sebastien Decugis wrote:

> I understand your point. My first attempt was to come up with such
> intermediate layer that would provide these two functions:
> send_to_stream(message, length, streamid);
> recv_from_stream(message, length, streamid);
> It would be quite straight-forward to use the user pointer from the
> session, or the connection object, to retrieve the stream id of a session.
> 
> Unfortunately, whereas the send function can be written quite easily, I
> cannot figure out how to write the recv function. Using the SCTP socket
> API [1], we do not specify the stream on which we are listening for a
> new message. Instead, we are listening for the next message from any
> stream, and when we receive it we can also get its stream id. That is a
> fundamental difference between a multistream SCTP association, and many
> separated connections.

Hello Sebastien,
 Actually I think the recv_from_stream() is doable. You should wait for
any message, then if it is not for this stream save it for later
processing. You only need to cache messages and read from the cache if
they exist. It is easy to describe but might be tricky implementing it.

The gnutls_recv function behave similarly. You can read from different
"streams" such as application data, handshake data etc. Only they are
read they are cached for later processing by someone who is interested.

regards,
Nikos





More information about the Gnutls-devel mailing list