1 package require Tcl 8.4
5 namespace eval ::ten:: {
6 set library [file dirname [info script]]
9 snit::type ten::connector::perl {
12 set conn_fh [open {|object-remote-node} r+]
13 set firstline [gets conn_fh]
16 default { error "Expected Shere, got $firstline" }
19 set channel [ten::read_channel %AUTO% -fh $conn_fh]
22 ten::connection %AUTO% -send_to_fh $conn_fh -read_channel $channel
29 snit::type ten::read_channel {
35 $self configurelist $args
36 fconfigure $options(-fh) -blocking 0
37 fileevent $options(-fh) readable [mymethod ReceiveData]
40 method ReceiveData {} {
41 set chan $options(-fh)
43 if [llength $options(-on_close_call)] {
44 eval $options(-on_close_call)
47 if [llength $options(-on_line_call)] {
48 while {[llength [set line [gets $chan]]] > 0} {
49 eval [concat $options(-on_line_call) $line]
56 package provide ten 0.0.01