February 15, 2016 Re: wrapSocket for socket_t? As wrapFile for FILE* | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ali Çehreli | On Sunday, 14 February 2016 at 08:19:16 UTC, Ali Çehreli wrote:
> On 02/14/2016 12:03 AM, Beginner-8 wrote:
>> Uh, wait! Forgot about that Socket calls .close() in its dtor
>
> Try duplicating the socket handle before handing it over to Socket (not compiled nor tested):
>
> import core.sys.posix.unistd;
>
> Socket(dup(myHandle))
>
> I think socket handles are duplicatable :p things. Only the last close() would actually close the socket.
>
> Ali
This recipe works for me! Thanks!
|
Copyright © 1999-2021 by the D Language Foundation