Gary Wright wrote: > On Jul 21, 2009, at 10:31 AM, Greg Chambers wrote: > >>> Gary Wright >> >> Okay, not too bad. Wait, if I send the fixnum ahead of time, is the >> number of bytes I need to receive dependent on how long the message is >> still? Or is there a way to send an integer always using 4 bytes or >> something like that? > > Look at Array#pack and String#unpack if you want to send binary > numeric values (i.e., 8-bit or 32-bit integers). > > I'd recommend going the text/newline approach if at all possible, > otherwise you are dealing with a binary protocol which can be more > difficult to work with. Such as: http://en.wikipedia.org/wiki/Netstrings -- Posted via http://www.ruby-forum.com/.