From 2aa08b954018e83bbcf8176dcadb17fdb62f1730 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Wed, 11 Apr 2018 01:49:31 -0600 Subject: [PATCH 1/3] fix: use correct id sequence (dialer even/listener odd) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5165cab..50cebe2 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ necessarily send the first packet, this distinction is just made to make the all ### Opening a new stream -To open a new stream, first allocate a new unique stream ID; the session initiator allocates odd IDs and the session receiver allocates even IDs. Then, send a message with the flag set to `NewStream`, the ID set to the newly +To open a new stream, first allocate a new unique stream ID; the session initiator allocates even IDs and the session receiver allocates odd IDs. Then, send a message with the flag set to `NewStream`, the ID set to the newly allocated stream ID, and the data of the message set to the name of the stream. Stream names are purely for interfaces and are not otherwise considered by the protocol. An empty string may also be used for the stream name, and they may also be repeated (using the same stream name for every stream is valid). Reusing From 506fb65493204b164c438018a8458d22db4b7c49 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Mon, 23 Apr 2018 12:17:49 -0600 Subject: [PATCH 2/3] clarify even/odd tag ussage remove mention of even/odd id numbering --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 50cebe2..90062fd 100644 --- a/README.md +++ b/README.md @@ -52,13 +52,13 @@ necessarily send the first packet, this distinction is just made to make the all ### Opening a new stream -To open a new stream, first allocate a new unique stream ID; the session initiator allocates even IDs and the session receiver allocates odd IDs. Then, send a message with the flag set to `NewStream`, the ID set to the newly +To open a new stream, first allocate a new unique stream ID. Then, send a message with the flag set to `NewStream`, the ID set to the newly allocated stream ID, and the data of the message set to the name of the stream. Stream names are purely for interfaces and are not otherwise considered by the protocol. An empty string may also be used for the stream name, and they may also be repeated (using the same stream name for every stream is valid). Reusing a stream ID after closing a stream may result in undefined behaviour. -The party that opens a stream is called the stream initiator. This is used for numbering the streams. +The party that opens a stream is called the stream initiator. This is used for numbering the streams as well as identifying whether the message comes from a channel opened locally or remotely. Thus, the stream initiator always uses even flags and stream receivers uses odd flags. ### Writing to a stream From ec210bd2d0c783ae36c973017275429bf2a8e5e2 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Tue, 29 May 2018 22:25:30 -0600 Subject: [PATCH 3/3] fix: corrections based on review --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 90062fd..cb26106 100644 --- a/README.md +++ b/README.md @@ -52,13 +52,11 @@ necessarily send the first packet, this distinction is just made to make the all ### Opening a new stream -To open a new stream, first allocate a new unique stream ID. Then, send a message with the flag set to `NewStream`, the ID set to the newly -allocated stream ID, and the data of the message set to the name of the stream. +To open a new stream, first allocate a new stream ID. Then, send a message with the flag set to `NewStream`, the ID set to the newly allocated stream ID, and the data of the message set to the name of the stream. -Stream names are purely for interfaces and are not otherwise considered by the protocol. An empty string may also be used for the stream name, and they may also be repeated (using the same stream name for every stream is valid). Reusing -a stream ID after closing a stream may result in undefined behaviour. +Stream names are purely for interfaces and are not otherwise considered by the protocol. An empty string may also be used for the stream name, and they may also be repeated (using the same stream name for every stream is valid). Reusing a stream ID after closing a stream may result in undefined behaviour. -The party that opens a stream is called the stream initiator. This is used for numbering the streams as well as identifying whether the message comes from a channel opened locally or remotely. Thus, the stream initiator always uses even flags and stream receivers uses odd flags. +The party that opens a stream is called the stream initiator. This is used to identify whether the message comes from a channel opened locally or remotely. Thus, the stream initiator always uses even flags and stream receivers uses odd flags. ### Writing to a stream