             return connectTimeout as! T.OptionType
         case _ as AllowRemoteHalfClosureOption:
             return allowRemoteHalfClosure as! T.OptionType
+        case _ as WriteSpinOption:
+            return pendingWrites.writeSpinCount as! T.OptionType
+        case _ as WriteBufferWaterMarkOption:
+            return pendingWrites.waterMark as! T.OptionType
         default:
             return try super.getOption0(option: option)
         }

        }
    }

    /// Read data from the underlying socket and dispatch it to the `ChannelPipeline`
    ///
    /// - returns: `true` if any data was read, `false` otherwise.
    @discardableResult fileprivate func readFromSocket() throws -> ReadResult {
        fatalError("this must be overridden by sub class")
    }

    fileprivate enum ReadResult {
        /// Nothing was read by the read operation.
        case none

        /// Some data was read by the read operation.
        case some
    }

    /// Write data from the underlying socket.
    ///
    /// - parameters:
    ///     - pendingWrites: `PendingWritesManager` that holds all the pending writes that may be ready to be written to the underlying socket.
    /// - returns: `true` if any data was read, `false` otherwise.
    fileprivate func writeToSocket(pendingWrites: PendingWritesManager) throws -> WriteResult {
        fatalError("this must be overridden by sub class")
    }

    public func channelRead0(data: NIOAny) {
        // Do nothing by default
    }

        self.socket = socket
        self.selectableEventLoop = eventLoop
        self.closePromise = eventLoop.newPromise()
        active.store(false)
        self._pipeline = ChannelPipeline(channel: self)
    }
}

