[Gambas-bugtracker] Bug #2310: Gambas Apps have isssues talking to other gambas apps started with exec

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Tue Jul 20 01:31:46 CEST 2021


http://gambaswiki.org/bugtracker/edit?object=BUG.2310&from=L21haW4-

Comment #16 by Brian G:

So, apart from the issue of zero bytes after pipe closes. before the app is killed or ends.


It would seem that my original problem of killing the task after sending the data.. was that

Application_read event does not fire on the first message that arrives only after the second.
Unless there is at least 0.1 seconds delay between the write and flush in the sending program.

This of course in my original app when I did not need the exec'ed app anymore and killed it, the data was lost
because the event did not fire when I only wrote one message. ... it was lost.

So the actual number of bytes available may change between the event dispatch and event process, but the closepipe may happen before the first dispatch.
So Lof() will report zero as the read is being done. It also seems possible that if all data is written and 

In the typical loop of

public sub My_read()
    while lof(last)                         ' this prevents the rest of the buffer from being read after the close
        buffer &= read #last, -256
    wend
end


It looks like the application_read, has some sort of check.




More information about the Bugtracker mailing list