Code: Select all
set idx [socket -async messenger.hotmail.com 1863]
while {[eof $idx] != ""} {
set data [gets $idx]
putlog "msn: $data"
}
}
if {![eof $idx]} {
Code: Select all
set sock [socket messenger.hotmail.com 1863]
puts $sock "USR 1 MD5 I you@hotmail.com"
puts $sock "USR 1 MD5 S blah"
flush $sock
while {[gets $sock text] != -1} {
putlog "Server: $text"
}
putlog "Server closed connection"
Code: Select all
[13:48] TCL error [test]: bad argument "text": should be "nonewline"
Code: Select all
while {$text != ""} {
set $text [read $sock]
msn:putchan "user" "$text"
}
Code: Select all
while {[validsock $sock]} {
set text [read $sock]
msn:putchan "user" "$text"
putlog "msn: $text"
if {[lindex $text 0] == "BYE"} {
close $sock
}
}
proc validsock {channel} {return [expr 1 - [catch "fconfigure $channel"]]}