Posted to tcl by kyak at Sun Oct 17 15:39:20 GMT 2021view raw

  1. package require tls
  2.  
  3. proc ircrecv {} {
  4. puts "ircrecv called"
  5. if {[eof $::irc]} {
  6. close $::irc
  7. }
  8.  
  9. if {[gets $::irc line] >= 0} {
  10. puts $line
  11. }
  12. }
  13.  
  14. set ::irc [::tls::socket irc.libera.chat 6697]
  15. fconfigure $::irc -blocking 0 -buffering line -translation crlf -encoding utf-8
  16. fileevent $::irc readable ircrecv
  17. vwait forever