 class TCPClientViewController: NSViewController {
 
     let port = UInt16(40000)
-    var clientChannel: TCPChannel!
+    var clientChannel: TCPChannel?
     var count: Int = 0
 
     dynamic var reconnect: Bool = false

    }

    @IBAction func ping(sender: AnyObject?) {
        clientChannel.write(DispatchData <Void> ()) {
            result in
        }

        clientChannel.shouldReconnect = {
            return self.reconnect
        }

        return clientChannel
    }

    @IBAction func connect(sender: AnyObject?) {

        if clientChannel == nil {
            try! clientChannel = createClient()
        }

        guard let clientChannel = clientChannel else {
            fatalError()
        }

        clientChannel.connect(retryDelay: 1 / 8) {
            (result) in

            if case .Failure(let error) = result {
                assert(clientChannel.state.value == .Unconnected)
                SwiftIO.log?.debug("Client connect callback: \(error)")
                return
            }
