             delegate?.printer(self, didChangeStatus: status)
         }
     }
+    public var printing: Bool
     
     public var portName: String {
         return portInfo.portName

    init(portInfo: PortInfo) {
        self.portInfo = portInfo
        self.status = .Disconnected
        
        self.queue.maxConcurrentOperationCount = 1
    }
    

        
        free(dataSentToPrinter)
        
        var token: dispatch_once_t = 0
        if queue.operationCount == 1 {
            printing = false
            closeConnection()
            token = 0
        } else {
            dispatch_once(&token) {
                dispatch_after(30, dispatch_get_main_queue()) {
                    if self.printing {
                        self.closeConnection()
                        token = 0
                    }
                }
            }
        }
    }

    private func establishConnection() throws {
        guard status == .Disconnected else {
            return
        }
        
        status = .Connecting
        var connected = false
        for _ in 0..<3 {
            connected = openPort()
            if connected {
                status = .Connected
                return
            }
            sleep(3)
        }
        
        status = .Disconnected
        throw PrintingError.EstablishingConnection
    }
    
    private func closeConnection() {
