Channels

Each BEEP session carries one or more channels simultaneously. A channel is a full-duplex pipe, and the application protocol designer specifies rules indicating who can initiate message exchanges, along with the syntax and semantics of those messages. In other words, a channel is a stream of “typed” messages. But, how do you know what the rules are?

In BEEP, someone writes a document called a “profile” that defines the rules. The profile itself is identified by a URI (Uniform Resource Identifier), such as http://iana.org/beep/syslog/COOKED. Note that the URI doesn’t have to be on the Web—it just has to authoritatively identify the document. So, in this example, the owner of iana.org is the only one allowed to name profiles with the prefix of http://iana.org. The ideas of channels and profiles are illustrated in Figure 2-2.

The channel precept

Figure 2-2. The channel precept

URIs were chosen to identify profiles because this allows anyone to define a profile! In the next two chapters, we’ll see several examples of profile definitions; for right now, the actual details aren’t that important.

Since you can have more than one channel active at the same time, you need a way of identifying them. Whoever asks to create a channel gives the other peer a list of profiles to choose from, along with an unused channel number. If it’s all good, the other peer replies with the profile that it wants to use, and ...

Get BEEP: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.