     ///        directly.
     public func handleBufferedReadData() {
         #if os(OSX) || os(iOS) || os(tvOS) || os(watchOS) || GCD_ASYNCH
-            socketReaderQueue(fd: socket.socketfd).sync() { [unowned self] in
-                _ = self.handleBufferedReadDataHelper()
+            if socket.socketfd != Socket.SOCKET_INVALID_DESCRIPTOR {
+                socketReaderQueue(fd: socket.socketfd).sync() { [unowned self] in
+                    _ = self.handleBufferedReadDataHelper()
+                }
             }
         #endif
     }

            readerSource.setEventHandler() {
                _ = self.handleRead()
            }
            readerSource.setCancelHandler() {
                self.handleCancel()
            }
            readerSource.resume()
        #endif
        

            writerSource = DispatchSource.makeWriteSource(fileDescriptor: socket.socketfd,
                                                          queue: IncomingSocketHandler.socketWriterQueue)
            
            writerSource!.setEventHandler(handler: self.handleWriteHelper)
            writerSource!.setCancelHandler() {
                self.writerSource = nil
            }
