Skip to content

Instantly share code, notes, and snippets.

@domenic
Forked from piscisaureus/gist:9077207
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save domenic/9077224 to your computer and use it in GitHub Desktop.
Save domenic/9077224 to your computer and use it in GitHub Desktop.
// Stream type: tcp
* fundamental unit: buffer given to us by the OS
* list representation: array of buffers
read() -> yields a Buffer containing whatever the OS gave us for that chunk
// Stream type: text lines (e.g. after splitting a text files into lines)
* fundamental unit: line (string)
* list representation: array
read() -> yields a string
// Stream type: UDP datagrams (boundaries matter)
* fundamental unit: datagram (Buffer)
* list representation: array
read() -> yields a buffer containing a full datagram
// Stream type: arbitrary objects
* fundamental unit: Object
* list representation: array
... guess what?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment