Revision: 10547 http://pure-data.svn.sourceforge.net/pure-data/?rev=10547&view=rev Author: eighthave Date: 2009-01-14 01:20:48 +0000 (Wed, 14 Jan 2009)
Log Message: ----------- switched socket channel to non-blocking, and changed reading the socket channel from 'gets' to 'read'
Modified Paths: -------------- branches/pd-devel/0.41.4/src/pd_connect.tcl
Modified: branches/pd-devel/0.41.4/src/pd_connect.tcl =================================================================== --- branches/pd-devel/0.41.4/src/pd_connect.tcl 2009-01-14 00:28:54 UTC (rev 10546) +++ branches/pd-devel/0.41.4/src/pd_connect.tcl 2009-01-14 01:20:48 UTC (rev 10547) @@ -10,7 +10,7 @@ }
proc ::pd_connect::configure_socket {sock} { - fconfigure $sock -blocking 1 -buffering line + fconfigure $sock -blocking 0 -buffering line fileevent $sock readable {::pd_connect::pd_readsocket ""} }
@@ -49,7 +49,6 @@ # send a pd/FUDI message from Tcl to Pd. This function aims to behave like a # [send] in Pd, except the first argument is the name to send to. proc ::pd_connect::pdsend {message} { # 'args' is special, it gets everything - puts "pdsend $message" variable pd_socket if {[catch {puts $pd_socket $message} errorname]} { puts stderr "pdsend errorname: >>$errorname<<" @@ -61,7 +60,7 @@ # TODO this currently drops leading whitespace, like tabs proc ::pd_connect::pd_readsocket {cmd_from_pd} { variable pd_socket - append cmd_from_pd [gets $pd_socket] + append cmd_from_pd [read $pd_socket] puts stderr "cmd_from_pd: $cmd_from_pd" if {[catch {uplevel #0 $cmd_from_pd} errorname]} { global errorInfo
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.