Chapter 18


Chapter 9

9.1

There are a number of situations where sctp_peeloff can play an important role. An example application that might use this function is a traditional UDP-like server that responds to requests such as small transactions, but occasionally is requested to do a long-term audit. In most cases, you only need to send one or two small messages and no more; but when a audit request arrives, a long- term conversation is invoked, sending audit information. In this situation, you would peel off the audit into its own thread or process to do the audit.

In summary, any application that has mainly small requests but on occasion needs to have a long-term conversation can take advantage of sctp_peeloff .

9.2

The server side closes automatically when the client closes the association. This is because SCTP does not support the half-closed state, so when the client calls close, the shutdown sequence will flush any pending data the server had queued for the client and complete the shutdown, closing the association.

9.3

In the one-to-one style, a connect call must be performed first, and so when the COOKIE is sent to the peer, no data is pending. For the one-to-many style, an application can send data to a peer to set up an association. This means that when the COOKIE is sent, the DATA is available to send to the peer.

9.4

The only time a peer that you would be setting up an association with would be able to send back data is if it had DATA pending BEFORE the connection was set up. This would occur if each side was using the one-to-many style and each side did a send to implicitly set up the association. This type of association setup is called an INIT collision, and details on it can be found in Chapter 4 of [Stewart and Xie 2001].

9.5

In some cases, not all addresses that are bound may be passed to a peer endpoint. In particular, when addresses that an application has bound contain both private and public IP addresses, only the public addresses may be shared with a peer endpoint. Another example is found in IPv6, where link-local addresses cannot necessarily be shared with a peer.




UNIX Network Programming Volume 1, Third Edition
Unix Network Programming, Volume 1: The Sockets Networking API (3rd Edition)
ISBN: 0131411551
EAN: 2147483647
Year: 2003
Pages: 441

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net