File: testclient.tcl

package info (click to toggle)
tcl-syslog 2.0.1-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 796 kB
  • sloc: ansic: 729; sh: 400; tcl: 388; makefile: 27
file content (21 lines) | stat: -rw-r--r-- 442 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
load ../libtcl9syslog1.3.0.so
proc writeServerChan {sk args} { puts $sk $args; flush $sk }
proc readServerChan {sk} { 
    if {[eof $sk]} { 
        close $sk 
        chan event $sk readable ""
        return
    }

    puts [gets $sk] 

}
set sk [socket 127.0.0.1 8888]

chan event $sk readable [list readServerChan $sk]
writeServerChan $sk wait literal "info message" 120000
::syslog::open -ident test
::syslog::log info "info message"