     }
     
     public func halt() {
-        close(self.sock)
         self.stop = true
     }
     

    }
    
    public func loop(once: Bool) {
        do {
            if once {
                try waitForData(nil)
                try processInput()
            } else {
                self.inputStream = self.inputStreamType.init(sock: self.sock)
                self.outputStream = self.outputStreamType.init(sock: self.sock)
                while !stop {
                    try waitForData(nil)
                    try processInput()
                }
            }
        } catch {
            
        }
    }
    

        guard record.contentLength != 0 , let cntData = record.contentData else {
            // A empty params is sent
            // tick the request

            try self.server.handleRequest(req)
            self.curRequest = nil
            return
