Advice wanted on garbage collection of sockets for c++ programmer using D

John Burton via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jun 28 08:55:41 PDT 2017


On Tuesday, 27 June 2017 at 09:54:19 UTC, John Burton wrote:
> I'm coming from a C++ background so I'm not too used to garbage 
> collection and it's implications. I have a function that 
> creates a std.socket.Socket using new and connects to a tcp 
> server, and writes some stuff to it. I then explicitly close 
> the socket, and the socket object goes out of scope.
>

> Am I doing this right? Or is there a better way to do this in D?
>
> Thanks.


For my use case here, I'm increasingly thinking that just calling 
the underlying 'C' socket and send calls is better. No need for 
anything complicated at all for my actual program :)



More information about the Digitalmars-d-learn mailing list