     private var closed: Bool = false
     private var connections: [SNTPConnection] = []
     private static let hostCallback: CFHostClientCallBack = { (host, infoType, error, info)  in
-        let client = unsafeBitCast(info, SNTPHost.self)
+        let client = Unmanaged<SNTPHost>.fromOpaque(COpaquePointer(info)).takeUnretainedValue()
         debugLog("Resolving hosts")
         client.connect(host)
     }

        let host = CFHostCreateWithName(nil, hostURL.absoluteString).takeUnretainedValue()
        var ctx = CFHostClientContext(
            version: 0,
            info: unsafeBitCast(self, UnsafeMutablePointer<Void>.self),
            retain: nil,
            release: nil,
            copyDescription: unsafeBitCast(0, CFAllocatorCopyDescriptionCallBack.self)

        let callbackTypes: [CFSocketCallBackType] = [.DataCallBack, .WriteCallBack]
        var ctx = CFSocketContext(
            version: 0,
            info: UnsafeMutablePointer(Unmanaged.passUnretained(self).toOpaque()),
            retain: nil,
            release: nil,
            copyDescription: unsafeBitCast(0, CFAllocatorCopyDescriptionCallBack.self)
