I'm not in a position to test this speculation, but try checking the value returned by Win32::GetLastError(), (which may or may not be the same as $^E), immediately after Peek() returns false. I would expect, but cannot substantiate that you woud get a different error code if the pipe is just empty, to if it has disconnected.
Maybe RPC_X_PIPE_EMPTY (1918L) in the former case and RPC_X_PIPE_CLOSED (1916L) in the latter. Those are guesses, there are several possibilities. Should be fairly easy to verify (once you have a working copy of a version of Win32::Pipe that supports the Peek() function :()
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] [select] |
I'm shooting in the dark here, but have you tried using the GetInfo() method?
According to the module's documentation:
GetInfo()
Retrieves an array of information about the pipe:
Element 0: State of Pipe
Element 1: Number of instances the pipe has
Element 2: Name of user connected as the client
Element 3: Max number of bytes collected before the pipe sends the
+ data
Element 4: Max amount of time before data is sent
I guess Element 0 there should provide something useful. Other than this, I can't provide any further help, sorry.
Just a side note, but I never really got it why Roth Consulting's modules aren't on the CPAN.
acid06 perl -e "print pack('h*', 16369646), scalar reverse $="
| [reply] [d/l] [select] |
Unfortunately, that 'state' field is bit encoded and can indicate blocking/non-blocking, and byte/message mode which doesn't help unless you can enable non-blocking mode and I don't think that module exposes that to Perl.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] |