MOO-cows Mailing List Archive


Re: Javascript/Java [Re: Interactive MOO]

Michael Moore wrote:
> It's even easier with version 1.8.0. This code segment will do the same thing
>  :
> set_connection_option (player,"binary",1)
> notify (player,"~1B[32m"+text)
> set_connection_option (player,"binary",0)

Beware that toggling the "binary" connection option may have unexpected
side-effects on your input stream.  I found when I was experiementing with
code like this (and with read() instead of notify()) that the player's
input stream is either stripped of binary characters or converted to the
~XX binary representation *at the time it arrives*, not at the time it is
consumed.  If you leave the binary option on long enough for the server to
process some data from the player's socket, you may get some unexpected
results.  The MOO "API" doesn't specify (or even document) when this might
happen.  This may be an argument for "binary-input" and "binary-output"
connection options and/or better specification/documentation.



Home | Subject Index | Thread Index