bind dcc - check pcheck:dcc
proc check:dcc {hand idx arg} {
set hst [lindex $arg 0]
set prt [lindex $arg 1]
set sock [socket $hst $prt]
if {![eof $sock] == 1} {
putlog "Connection established"
close $sock
} else {
putlog "Connection failed."
}
}
ok so far so good but now if the socket can't connect it shows an error .. ?
also how can i make it connect to an udp port ?
TCL does not natively support udp connections. From my understanding, TCL8.4.x was supposed to include support but they decided against it. You will need to google for a TCL udp extension, or create your own.
i know if {[catch [....] error] == 1} just do not understand the manual about that .. could you xplain it maybe little closer .. what it exactly does and what i need to think about when i script this cause ive tryed that and it sometimes did say it connected even tho there was no open port so .. euhm it did connect to the ip but .. well you get the point i think.