[Geany] Re: The way we handle the FIFO.

Alexandre Moreira alexandream at xxxxx
Mon Jul 24 16:49:14 UTC 2006


2006/7/24, Alexandre Moreira <alexandream at gmail.com>:
>
> Hello, everyone.
>
> I've been thinking about some stuff these days, and I'd like to see what
> you think about it. I didn't give it much thought yet, so it may be that
> someone will readily point out why it is not a good idea and move on, so I
> decided to post before giving any deeper research to the problem.
>
> Right now, whenever the user opens a new empty instance of geany, geany
> checks out to see if the FIFO exists, and if it does, it asks the user what
> to do, if it should skip launching or if it should delete the pipe and open.
>
>
> But I think asking the user is rather annoying, and would like to give
> Geany the ability to try to connect to the pipe, send a ping message wait
> for, say, 3 or 5 seconds (enough time for a process to reply a pipe ping
> message) and if it doesnt reply, deletes the pipe and runs itsel. If it does
> reply, we skip launching and raise the old instance.
>
> Of course we would be trading the annoyance of asking the user for the
> annoyance of the time spent in the ping wait, and adding more code to the
> base (which could have its own bugs). But I think the code increase is not
> really significant (a select() could do it, in posix at least) and the time
> the user would take to read and answer the message box would be pretty much
> the same that Geany would take to check if the pipe is "alive".
>
> I am still in doubt wether this can be achieved easily in windows (I
> remind reading somewhere last week that windows' select() only applies to
> winsocks file descriptors...bummer) and don't know what you guys think of
> it, hence I did not do any work on this matter.
>

Just to correct myself, I just found out that it is possible to set timeouts
in the  ReadFile() API call for windows, using Communications Structures
(COMMTIMEOUTS) and Communications Functions (SetCommTimeouts), so the
question is not about the achievability of the feature in Win32 anymore, but
on the actual merits of the feature.

Regards,
Alexandre Moreira

PS: I can really thank the Geany project, for giving me reason to learn a
bit about Windows programming (lol). Learning is never too much.

Regards,
> Alexandre Moreira.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/users/attachments/20060724/b49cbc28/attachment.html>


More information about the Users mailing list