+2008-07-05 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * generic/udp_tcl.c: Applied patch 1848365 to accept any boolean
+ value for the -mcastloop option (plus tests).
+
2007-04-10 Pat Thoyts <patthoyts@users.sourceforge.net>
* generic/udp_tcl.c: Applied patch 1693037 from Uwe Klein to
} else if (!strcmp("-mcastloop", optionName)) {
int tmp = 1;
- r = Tcl_GetInt(interp, newValue, &tmp);
+ r = Tcl_GetBoolean(interp, newValue, &tmp);
if (r == TCL_OK) {
unsigned char ctmp = (unsigned char)tmp;
if (setsockopt(statePtr->sock, IPPROTO_IP, IP_MULTICAST_LOOP,
#ifdef WIN32
LPVOID sMsg;
DWORD len = 0;
+
len = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER
| FORMAT_MESSAGE_FROM_SYSTEM
| FORMAT_MESSAGE_IGNORE_INSERTS,
package require udp
-# Some tests are marked as slow as they can take 30s to test a volume of packets.
-# We generally just test for correctness and these do not significantly contribute
-# in testing correctness.
-::tcltest::testConstraint slow 1
+# Some tests are marked as slow as they can take 30s to test a volume
+# of packets. We generally just test for correctness and these do not
+# significantly contribute in testing correctness.
+::tcltest::testConstraint slow 0
# Enable printing timing information during some tests.
::tcltest::testConstraint timestamp 1
} msg] $msg
} {0 0x007b}
+test udp-3.8 {multicastloop can be set to true} \
+ -body {
+ set s [udp_open]
+ fconfigure $s -mcastloop "true"
+ fconfigure $s -mcastloop
+ } -result {1} -cleanup {
+ close $s
+ }
+
+test udp-3.9 {multicastloop can be set to false} \
+ -body {
+ set s [udp_open]
+ fconfigure $s -mcastloop "true"
+ fconfigure $s -mcastloop "no"
+ fconfigure $s -mcastloop
+ } -result {0} -cleanup {
+ close $s
+ }
# -------------------------------------------------------------------------
# cleanup