Extended Conversations

There's a definite limitation to the kind of communication just shown. It's fine if one program has to ask another a single question and it is satisfied with that, but what if some slightly more involved protocol needs to be negotiated? Consider a meeting between spy1 and spy2, who have never before seen each other face to face. spy1 needs a secret from spy2. spy2 is willing to tell the secret but needs to be assured of the identity of spy1, and spy1 isn't entirely sure of the identity of spy2 either. Consequently, when planning to meet for the first time, they agree on specific pleasantries that will be exchanged before getting down to business. If either spy says the wrong thing during the first three messages, somebody ...

Get Sams Teach Yourself Ruby in 21 Days 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.