下載 TLS v1.6.4 以後使用之前 MinGW/MSYS 的方式編譯,確定可以編譯。
測試的 script 從 Tcler's Wiki 來的:
package require tls
variable quit 0
proc Read {chan} {
if {[eof $chan]} { fileevent $chan readable {}; puts "Closed"; set ::forever 1; return }
puts [read $chan]
variable quit ; if {!$quit} { puts $chan QUIT; set quit 0 }
}
proc Write {chan} {
fileevent $chan writable {}
tls::handshake $chan
fconfigure $chan -buffering line -blocking 0 -translation crlf
}
set sock [tls::socket -async pop.gmail.com 995]
fconfigure $sock -encoding binary -buffering none -blocking 1
fileevent $sock writable [list Write $sock]
fileevent $sock readable [list Read $sock]
vwait ::forever
沒有留言:
張貼留言