in reply to Re^3: Non-blocking Reads from Pipe Filehandle
in thread Non-blocking Reads from Pipe Filehandle
Hm, Maybe you're right, but it doesn't seem to be necessary
It stopped your program from working for over a year. It's forcing you to have to OS do unnecessary and possible unwanted work. It's definitely a necessity even though though it could be fudged this time.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: ... (Proof!)
by BrowserUk (Patriarch) on Oct 01, 2008 at 03:40 UTC | |
It's definitely a necessity even though though it could be fudged this time. For the record. This is from API.XS:
So, if you work with the module instead of fighting it, and use 0 (zero) instead of undef to indicate that you want this pointer parameter set to null, that's what it does! Ie. it's not a "fudge", but how the author designed it! Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] |
by ikegami (Patriarch) on Oct 01, 2008 at 04:00 UTC | |
I used 0. Didn't work. But then again, has_proto is true for the snippet that shows the problem. What's getting you so excited? Update: Bug report. Proposed change:
| [reply] [d/l] [select] |
by BrowserUk (Patriarch) on Oct 01, 2008 at 04:59 UTC | |
I used 0. Didn't work. Probably because your protoype is wrong. This: my $f = Win32::API->new('kernel32', 'PeekNamedPipe', 'LLLLLL', 'L') Should be this: my $f = Win32::API->new('kernel32', 'PeekNamedPipe', 'LPLPPP', 'L') Fix that, and your 'fix' above is unnecessary. Just another hack at a module that worked fine for the most part before people start trying 'fix it' without enough knowledge to do so. I wouldn't call it excitement. More depression when I see people proffering this kind unnecessary complexity:
for the sake of a little reading, and a couple of zeros. The icing on the cake is when they try to claim the technical high ground as justifiction for it. Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] [select] |
by ikegami (Patriarch) on Oct 01, 2008 at 05:31 UTC | |
by ikegami (Patriarch) on Oct 01, 2008 at 06:25 UTC | |
lpTotalBytesAvail and lpBytesLeftThisMessage are both LPDWORD. You pass zero to both. Yet, you want me to believe doing so results in passing a non-NULL pointer for lpTotalBytesAvail and a NULL pointer for lpBytesLeftThisMessage? | [reply] [d/l] [select] |
by BrowserUk (Patriarch) on Oct 01, 2008 at 07:34 UTC | |
No. Both are passed as NULL-pointers:
If you look closely, you'll see that I am not actually using lpTotalBytesAvail / $cAvail. I was in an early cut of the code, but then I realised that I didn't need to. It is easier to extract the information I need directly from the buffer. When I was using $cAvail, it was coded like to this:
Which produces this output:
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] [select] |
|
Re^5:Non-blocking Reads from Pipe Filehandle
by BrowserUk (Patriarch) on Oct 01, 2008 at 02:31 UTC | |
It stopped your program from working for over a year. It's forcing you to have to OS do unnecessary and possible unwanted work. It's definitely a necessity even though though it could be fudged this time. Oh dear. You really do talk bollocks sometimes! My "program" was a throw away attempt at something to which I already had (and posted) a simpler, better alternative. What stopped that throw-away from working, for the whole 10 minutes I spent on it, had absolutely nothing to do with all your ballshit above about "having to manage your own buffers". As I demonstrated, that is all completely unnecessary. You (and your mentor) just like doing things the hard way for some reason. Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] |