On Tue, 30 Aug 2005, Micha Nelissen wrote:

> On Tue, 30 Aug 2005 12:20:40 +0200 (Romance Daylight Time)
> Michael Van Canneyt <[EMAIL PROTECTED]> wrote:
>
> > You can wait on any handle: file, pipe, socket.
> >
> > From msdn:
> >
> > The WaitForSingleObject function can wait for the following objects:
> >
> >     * Change notification
> >     * Console input
> >     * Event
> >     * Job
> >     * Memory resource notification
> >     * Mutex
> >     * Process
> >     * Semaphore
> >     * Thread
> >     * Waitable timer
>
> Well, I don't see neither file, nor pipe, nor socket in this list.
> (That's why I made that specific comment, earlier). The documentation says
> waiting for file and pipe handles works in "some circumstances" but it
> should not be used.

It works. They even forgot to mention sockets.
The point is that it interferes with the message queue. in other words,
while using WaitForSingleObject(), your app will not respond to messages.

That is why they recommend MsgWaitForMultipleObjects(), this should work on 
both,
and will warn about files and about arrived messages.

In each case, I have everything working now both on Windows and Linux,
both command-line and GUI apps. I'll commit the SimpleIPC implementation
in the FCL.

I can send the rest (GUI demo apps & debugserver stuff) to the lazarus team,
if they want.

Michael.

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to