Skip to content

Instantly share code, notes, and snippets.

@et4te
Created July 2, 2011 17:21
Show Gist options
  • Save et4te/1061371 to your computer and use it in GitHub Desktop.
Save et4te/1061371 to your computer and use it in GitHub Desktop.
Bit too easy to do in this lang...
USING: io io.encodings.binary io.sockets byte-arrays.hex ;
IN: riak
! ----------------------------------------------------------------------------
CONSTANT: rpb-ping-req HEX{ 00 00 00 01 01 }
CONSTANT: rpb-ping-resp HEX{ 00 00 00 01 02 }
CONSTANT: rpb-get-client-id-req HEX{ 00 00 00 01 03 }
CONSTANT: rpb-get-client-id-resp HEX{ 00 00 00 07 04 0A 04 01 65 01 B5 }
: request ( req -- resp )
"127.0.0.1" 8087 <inet> binary [
write flush 5 read
] with-client ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment