pipe channel getting blocked on windows
From: yahalom (yahalome_at_XOR-T.COM)
Date: 05/31/04
- Next message: Hao Xu: "Re: A question about Chinese input"
- Previous message: Phil Powell: "Re: Is there a one-liner for this?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 30 May 2004 20:53:52 -0700
I have a program that opens a pipe to a channel on linux and on
windows. when the channel does not return after a while I have set a
timeout on it.
when I try to close the channel it waits until the channel exists.
I set the channel to non-blocking mode and it works fine on linux. on
windows it still hangs.
how can I force the channel to exit?
set timeoutFlag 0
set ofd [open "|d:/blockingProgram" r+]
puts $ofd "please don't block..."
catch {flush $ofd}
fileevent $ofd readable [list set timeoutFlag 2]
set afterId [after 2000 [list set timeoutFlag 1]]
vwait timeoutFlag
if {$timeoutFlag==1} {
puts "reached timeout"
fconfigure $ofd -blocking 0
catch {close $ofd}
} else {
#do something
}
- Next message: Hao Xu: "Re: A question about Chinese input"
- Previous message: Phil Powell: "Re: Is there a one-liner for this?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|