Hi Lance,
>> It seems I failed to express myself clearly. Here I go again. :-)
>> I understand the need for the ACE_OS::last_error() function. What I don't
>> understand is the reason for its particular windows implementation.
>> Specifically, why does it favour returning errno, rather than
>> GetLastError()?
As I said earlier, the intent was to replace the direct use of errno
in the ACE code, particularly for the ACE C++ socket wrapper facades.
These wrapper facades typically check errno since that is common
across both Windows and UNIX for socket operations. Only if errno is
0 is the value of GetLastError() returned. If we *hadn't* done this,
then there would have been all sorts of special-case code in the ACE
wrapper facades.
>> In my experience, on Windows GetLastError is sometimes much
>> more specific about the problem that occurred.
I agree, which is why you need to be careful when using
ACE_OS::last_error(), which has a very specific purpose that I
described above.
Take care,
Doug
--
Dr. Douglas C. Schmidt, Professor TEL: (615) 343-8197
Electrical Engineering and Computer Science FAX: (615) 343-7440
Vanderbilt University WEB: www.cs.wustl.edu/~schmidt/
Nashville, TN 37203 NET: d.schmidt@vanderbilt.edu