We are reasoning too much...
1. Compiling the code on Windows 64 made clear there's some inconsistency in 
the code...
2. This inconsistence is on how sockets are declared: 95% and more of the times 
as SOCKET and the rest of the times as int
3. On UNIX and WIN32 no problem cause SOCKET and int have the same size
4. On WIN64 there's a problem cause SOCKET and int do not have the same size 
and the helpful example Dossy made and I compiled on Win32 and Win34 elegantly 
shows that.
5. We have a good opportunity to clean the code, making it more consistent and 
more portable...
6. I insist on the need to make this little walk on the code base to make it 
consistent... We should use everywhere SOCKET.

What are we waiting for?

:-)   :-)   :-)



-----Original Message-----
From: AOLserver Discussion [mailto:AOLSERVER@LISTSERV.AOL.COM] On Behalf Of Jim 
Davidson
Sent: 04 August 2011 20:22
To: AOLSERVER@LISTSERV.AOL.COM
Subject: Re: [AOLSERVER] Aolserver Progress - Some few examples....

Hi

It's a socket so it can be monitored by select and poll. It should be SOCKET, I 
think it was in the past. 

On windows "lib-c" file handles returned by _open aren't the same as sockets.  
You can see this in the libc source Microsoft provides.  They can't be 
monitored with select.   The ns_sockpair is a pipe-like thing on windows by 
using socket calls to actually listen and connect on a localhost network 
socket.  

Net: seems I does need to change to SOCKET and that should have no effect on 
unix. 

Warning: I'm going on memory, not looking at the code. 

Jim


Sent from a phone

On Aug 4, 2011, at 11:34 AM, Jeff Rogers <dv...@diphi.com> wrote:

> Dossy Shiobara wrote:
>>  It's probably safer to define this as SOCKET, but windows.h says 
>> SOCKET is:
> 
> The source comment is misleading, because trigger is set up as a 
> socket pair, not as a pipe.  Not sure why it's this way, but there it 
> is.  And ns_sockpair is already prototyped as
> 
> ns_sockpair(SOCKET *socks)
> 
> so if this is a problem it really should be triggering a compiler warning 
> about it.  In any case, since unix defines SOCKET as int, it should make zero 
> difference on the unix side to change the structure definition.
> 
> -J
> 
>> 
>> typedef u_int SOCKET;
>> 
>> And:
>> 
>> typedef unsigned int u_int;
>> 
>> Since Windows is LLP64 and most Unix-like systems are LP64, I don't 
>> understand how AOLserver's defining trigger[2] as (int) is the 
>> problem
>> -- Windows might complain about some signed/unsigned thing at compile 
>> time, but in both cases, (int) is 32 bits.
>> 
>> 
>> On 8/4/11 3:24 AM, Maurizio Martignano wrote:
>>> int trigger[2]; /* Wakeup trigger pipe. */ ß Why is this an int when 
>>> it was a SOCKET (any justification????)
>> 
>> --
>> Dossy Shiobara         |      "He realized the fastest way to change
>> do...@panoptic.com      |   is to laugh at your own folly -- then you
>> http://panoptic.com/    |   can let go and quickly move on." (p. 70)
>>   * WordPress * jQuery * MySQL * Security * Business Continuity *
>> 
>> -- AOLserver - http://www.aolserver.com/
>> 
>> To Remove yourself from this list, simply send an email to 
>> <lists...@listserv.aol.com> with the body of "SIGNOFF AOLSERVER" in 
>> the email message. You can leave the Subject: field of your email blank.
>> 
> 
> 
> --
> AOLserver - http://www.aolserver.com/
> 
> To Remove yourself from this list, simply send an email to 
> <lists...@listserv.aol.com> with the body of "SIGNOFF AOLSERVER" in the email 
> message. You can leave the Subject: field of your email blank.


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to 
<lists...@listserv.aol.com> with the body of "SIGNOFF AOLSERVER" in the email 
message. You can leave the Subject: field of your email blank.


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to 
<lists...@listserv.aol.com> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to