read-tnetstring
write-tnetstring
value->bytes/ tnetstring
bytes->value/ tnetstring
Version: 5.2

Tagged Netstrings

 (require (planet gerard/tnetstrings))

(read-tnetstring [port])  any?
  port : input-port? = (current-input-port)

Reads a single value (encoded as a tnetstring) from port, and returns it as a scheme value.

(write-tnetstring [port])  exact-nonnegative-integer?
  port : output-port? = (current-output-port)

Encodes a single racket value as a tnetstring and writes it to port, the result is the number of bytes written.

(value->bytes/tnetstring val)  bytes?
  val : any?

The result is a byte-string containing val encoded as a tnetstring.

(bytes->value/tnetstring bstr)  any?
  bstr : bytes?

The result is the value that was encoded in bstr

This is how the Netstrings types are mapped to racket types.

string

bytes?

integer

exact?

float

inexact?

null

void?

boolean

boolean?

dictionary

hash?

list

list?