gnunet-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-developers] Re: [PHP] Win32 select()


From: Wez Furlong
Subject: [GNUnet-developers] Re: [PHP] Win32 select()
Date: Tue, 16 Dec 2003 13:02:43 -0000

Hi Nick,

Sure, you can use this code under a GPL style license.
A couple of comments though; if you want to allow use of this
function as a portable usleep(), you should either call the native
winsock select() instead of Sleep() (which only has ms resolution),
or (since I'm not sure if the winsock function supports that usage),
take a look at the usleep implementation under php-src/win32/time.c,
which I also wrote.  The caveat with that one is that it is not
compatible with win95, but you can acheive that compatibility
by dynamically loading the relevant function from the DLL.

Also, your check for read data using lseek... shouldn't that
be using handle_slot_to_fd[i] instead of handles[i] (which is
the native win32 HANDLE)? Also, is seeking really safe? it seems
to me that you will loose the current file position with that
code, and that it won't work on pipes.

--Wez.

----- Original Message ----- 
From: "N. Durner" <address@hidden>
To: <address@hidden>
Cc: <address@hidden>
Sent: Tuesday, December 16, 2003 12:33 PM
Subject: [PHP] Win32 select()


> Hi,
> 
> I have extended your implementation of select() for Windows and want
> to ask for permission to use it in a GPL'ed project
> (GNUnet - www.ovmj.org/GNUnet/) under a GPL-compatible license
> (http://www.gnu.org/philosophy/license-list.html#GPLCompatibleLicenses).
> My extensions are:
>  - NULL sets are allowed (IEEE Std 1003.1, 2003 Edition)
>  - errno is set according to GetLastError() ("SetErrnoFromWinError()")
>  - Read handles are sometimes signaled for no obvious reason. I have
>    added a check to see if there's really data pending.
> 
> I have attached my version (sorry, no patch - I have reformatted the
> source a bit).
> 
> Please CC your answer to address@hidden
> 
> Thanks a lot,
> 
> Nils Durner
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]