[vtkusers] Tcl sockets with vtk Binary data

Ed Stewart estewart at vni.com
Tue Aug 21 16:26:10 EDT 2001


Greetings,

I'm using a socket connection to get data to a Tcl shell which processes vtk
commands. When constructing ASCII data to send, I have been substituting VT
("\v") where the byte stream needs LF ("\n") in my output stream, appending
a \n at the end of everything to terminate the socket connection. Then on
the tcl side, I just look for \v chars to parse the packet type, variable
names, etc. This works like a charm.

I'm trying to move to BINARY now but have run into problems with LF bytes
that show up in the data stream. Once a LF is sent, the socket connection is
reset (I get a "bgerrer"). I can still use the \v to parse the keywords, but
I need a way to get Tcl to stop listening for LF bytes until the very end.

I've been looking and looking and can't find anything. I've tried using
fconfigure with "-translation binary" but this just prevents translation, it
doesn't ignore LFs. Any ideas?

Thanks,
-ed




More information about the vtkusers mailing list