         }
     }
 
-
-    ///The socket descriptor
-    public let fd: Int32
-
-
-    ///Initialise with an existing descriptor
-    public init(fd: Int32) {
-        self.fd = fd
-    }
 
     public enum SocketType : RawRepresentable {
 

    Wrapper for socket descriptor, providing a slightly friendlier interface to the socket API
    Lifetime management is NOT handled
*/
public struct Socket6 : Hashable, CustomDebugStringConvertible {

    public var debugDescription: String {
        return "fd \(fd): \(sockname) -> \(peername?.debugDescription ?? "unconnected")"
    }

    public var hashValue: Int { return Int(fd) }
    public static func ==(lhs: Socket6, rhs: Socket6) -> Bool { return lhs.fd == rhs.fd }

    private func check(_ result: Int) throws { try check(Int32(result)) }
    private func check(_ result: Int32) throws {
        guard result >= 0 else {

            }
        }
    }
    public init(type: SocketType = .stream) {
        self.init(fd: socket(AF_INET6, type.rawValue, 0))
    }

