 /// This should not be created directly but one of its sub-classes should be used, like `ServerSocket` or `Socket`.
 class BaseSocket: Selectable {
 
-    private let descriptor: CInt
-    public private(set) var isOpen: Bool
+    private var descriptor: CInt
+    public var isOpen: Bool {
+        return descriptor >= 0
+    }
 
     func withUnsafeFileDescriptor<T>(_ body: (CInt) throws -> T) throws -> T {
         guard self.isOpen else {

            try Posix.close(descriptor: fd)
        }

        self.isOpen = false
    }
}


    /// - parameters:
    ///     - descriptor: The file descriptor to wrap.
    init(descriptor: CInt) {
        precondition(descriptor >= 0, "invalid file descriptor")
        self.descriptor = descriptor
    }

    deinit {
