[[...]] [Tcl-dp] [Scotty] [pktsrc] http://www.cs.columbia.edu/~xiaotaow/research/tcludp/ [[no broadcast capability?]] Yes, it has the capability to transmit, via puts. Also http://students.cs.tamu.edu/mmiller/tcl/channel.html . ---- 30Jan2003 [Mike Tuxford] It was mentioned in c.l.t that there aren't many examples of tcludp usage around so I'll add this simple one that listens on port 1434 which is the MSSQL port and has been in the news a lot lately due to major exploits. proc udpEventHandler {} { global fd puts "event triggered..." puts "Data: [gets $fd(udp)]" puts "Peer: [udp_conf $fd(udp) -peer]" return } set fd(udp) [udp_open 1434] fileevent $fd(udp) readable udpEventHandler puts "Listening on udp port: [udp_conf $fd(udp) -myport]" vwait __forever__ ---- [[[PT]]] writes: First - thank you for giving an example - I find that I need to stop buffering as well using 'fconfigure $fd(udp) -buffering none' The above example looks to be using tcludp. I have some trouble with this package. It isn't stubsified, it doesn't present itself as a package and it fails to work for binary data (at least on windows). Try sending a packet like set s [udp_open] fconfigure $s -buffering none -translation binary udp_conf $s localhost 1434 puts -nonewline "Hello, World" puts -nonewline $s "\x00\x01\x02\x03\x04" The first ASCII packet is OK but the second stops at the first null and the remainder of the received packet is made up of leftovers from the receiving buffer. Looking at the package code - it is using the older style argv passing Tcl command API. Fixing it up to use Tcl_Obj might help with binary handling. Is anyone actively maintaining this package? Does it work better under unix? And what license is the code under. I'm somewhat tempted to fix it so I can use it with the tcllib dns package - but I need to clarify the license. ---- [[ [Category Internet] ]]