March 16, 2010
2:44 a.m.
Hello, it looks like its unsafe to switch between ascii/binary mode in SocketStream, because it resets buffers upon switch: binary "Tell the SocketStream to send data as ByteArrays instead of Strings. Default is ascii." binary := true. self resetBuffers The dynamic mode switching is useful: for instance i want to read HTTP headers first, which is preferable to do in ascii mode, but its contents may be binary , which obviously preferable to read in binary mode, to avoid extra conversions. Since SocketStream caching the data it reads, then instead of resetting the buffers it should convert them and avoid losing the data. What you think is an appropriate solution to this? -- Best regards, Igor Stasenko AKA sig.