[phobos] RAII implementation for Socket and Selector

Jose Armando Garcia jsancio at gmail.com
Tue Jun 21 20:55:30 PDT 2011


On Tue, Jun 21, 2011 at 10:07 PM, David Nadlinger <code at klickverbot.at> wrote:
> On 6/21/11 1:24 AM, Jose Armando Garcia wrote:
>>>
>>> - How to define SSLSocket?
>>
>> If we can bundle openssl, then we should probably provide that. Need
>> to think about the design.
>
> Just a short note, more to follow soon: Be sure to provide some way of
> accessing the underlying socket handle – you need it when interfacing with
> some C libraries, like OpenSSL.
>

You are right that we will probably wont have a choice but to expose
the handle. I would like to avoid that because if we expose the handle
it is not safe to close the handle once the ref count goes to zero. I
am thinking of instead returning a duplicate handle. I think that
should work really nicely.

I am hopping to also implement an SSLSocket (not sure exactly how the
API will work). It wont remove the need to expose the handle but it
should reduce the need for the user to have to manage the exposed
duplicate handle.

Thanks,
-Jose


More information about the phobos mailing list