hi for now, i use the same proc as yours, but for huge data transfer, it blocks Tk
my pd GUI works like this, at first my tries didnt work (was blocking the entire tk event loop). but eventually a combination of mathieu's emails and some tutorial circa tcl 7.3 worked..
you can get the code from cvs -d :pserver:anonymous@cvs.sf.net:cvsroot/pure-data co -r devel_0_39 pd/src/pd*tk* heres the relevant server bits:
variable pd_send if {[catch {set pd_send [socket localhost 4400]}]} {set pd_send
-1} {puts "connected $pd_send"} catch { set pd_receive [socket -server ::pd::receive_conn 4401] } proc receive_conn {s addr port} { fileevent $s readable [list ::pd::receive $s] fconfigure $s -buffering line -blocking 0 puts "connection from $addr" } proc receive {s} { set l [gets $s] if {[eof $s]} { close $s } else { if {[catch {eval $l}]} {puts "error in: $l"} } } proc send {msg} { variable pd_send if {$pd_send ne -1} { # puts "sending: $msg" puts $pd_send [concat $msg ;] flush $pd_send } }
so, i had i idea: i will make an external to link tcl variable with pd variable, without using network. is it a bad idea?
if you get an in-process interpreter thread running as an external, please post!, id love to try..
i'm tryin.....
carmen