Hi,
I'm trying to make a client for the DC protocol using Tcl/Tk. The major problem is that this protocol doesn't send endlines, but rather the | character to end a command.
This poses great problems. For one, 'gets' will always return an empty string, and 'read' will block when reading more characters than are waiting, even when in nonblocking mode.
Secondly I cannot use the 'fileevent readable' command, because the socket doesn't become unreadable as that is done after reading and endline character (so I gather), so the script is executed only once, at the initiation of the 'fileevent'.
How can I solve this?
I'm trying to make a client for the DC protocol using Tcl/Tk. The major problem is that this protocol doesn't send endlines, but rather the | character to end a command.
This poses great problems. For one, 'gets' will always return an empty string, and 'read' will block when reading more characters than are waiting, even when in nonblocking mode.
Secondly I cannot use the 'fileevent readable' command, because the socket doesn't become unreadable as that is done after reading and endline character (so I gather), so the script is executed only once, at the initiation of the 'fileevent'.
How can I solve this?