When a Tcl_DriverInputProc() returns the value 0,
the core I/O parts of Tcl take that to mean a signal
of EOF on the channel. udpInput() is returning 0
in several places when it does not intend that meaning.
See http://core.tcl.tk/tcl/tktview/1ff0660e6e
for a rundown of the corrections that are needed.
The Tcl 8.5.16 release candidate contains revisions
where the Tcl I/O core has started believing the
claims sent back from channel drivers. If a driver
says it's reached EOF, the I/O core won't call its
input proc anymore. As things currently stand, these
bugs will have to be fixed for tcludp to work with
Tcl 8.5.16.
For the sake of the existing deployed extensions,
I'll be looking into what accommodations might be
offered before 8.5.16 release, but the sooner the
bugs in extensions are fixed, the better.
I had to do some guess work on this.
May need review and revision.
But on the demo script I have, this patch
solves the problem with Tcl 8.5.16 and Tcl 8.6.2.
Don,
I'm abroad for the last three weeks (and 1 week to come) with limited email access hence my late response. Since I don't have my tclupd development environment with me, I cannot properly test your patch. I can commit the change though if you (or someone else) can confirm that this patch is correct.
Regards,
Huub
I'd greatly prefer review by an independent set
of eyes -- ideally those of someone invested in
the success of tcludp.
As things stand, the Tcl 8.5.16 release will
accommodate existing tcludp releases. Tcl 8.6.2
will not, and I expect tcludp packages to fail with
it unless this patch, or some revision of it, is
accepted and a corrected tcludp release restores
things.
I'll take a look at it when I'm back.
I am unable to reproduce the problem. What I've done so far is:
1. Downloaded and build the tcl 8.5.15 version using the link http://prdownloads.sourceforge.net/tcl/tcl861-src.zip
2. Build the tcludp package (without your patch) against it.
3. Run the following script as described in the ticket (https://groups.google.com/forum/#!topic/comp.lang.tcl/sRr678PXFfM) :
The output I get is:
127.0.0.1 58965: 12 {Hello, World}
127.0.0.1 58965: 1 {
}
127.0.0.1 39474: 12 {Hello, World}
127.0.0.1 39474: 1 {
}
127.0.0.1 49044: 12 {Hello, World}
127.0.0.1 49044: 1 {
}
...
which indicates to me that tcludp is working fine.
All above was done on a Fedora 17 virtual machine using Virtual Box.
Please demonstrate the problem with
the release candidate of Tcl 8.6.2:
ftp://ftp.tcl.tk/pub/tcl/tcl8_6/tcl862rc1-src.zip
Diff:
Solved in version 1.0.11