wrapSocket for socket_t? As wrapFile for FILE*

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Feb 13 20:27:15 PST 2016


On Sunday, 14 February 2016 at 04:13:12 UTC, Beginner-8 wrote:
> Anyone seen Socket constructor which uses already available 
> socket of socket_t type?


See the list on my unofficial docs here:

http://dpldocs.info/experimental-docs/std.socket.Socket.html

This one does it:

http://dpldocs.info/experimental-docs/std.socket.Socket.this.5.html




or the official docs here:

http://dlang.org/phobos/std_socket.html#.Socket.this.3


But basically you can just do:

    auto socket = new Socket(your_socket_t, AddressFamily.INET); 
// or whatever it is


AddressFamilies are:
http://dpldocs.info/experimental-docs/std.socket.AddressFamily.html



More information about the Digitalmars-d-learn mailing list