         return socketFD
     }
     public let channel: dispatch_io_t
-    
     public var eventEmitter: IOStreamEventEmitter = IOStreamEventEmitter()
-    
-    private let connectingSource: dispatch_source_t
     
     public convenience init(loop: RunLoop) {
         self.init(loop: loop, fd: SocketFileDescriptor(socketType: SocketType.stream, addressFamily: AddressFamily.inet))

                if result != 0 {
                    try! { throw Error(rawValue: Int32(result)) }()
                }
                log.debug("Bytes available for connection: \(dispatch_source_get_data(connectingSource))")
                dispatch_source_cancel(connectingSource)
                onConnect()
            }
            dispatch_resume(connectingSource)
        } else {
            throw error
        }
    }
    
    func close () {
        if dispatch_source_testcancel(self.connectingSource) == 0 {
            dispatch_source_cancel(self.connectingSource)
        }
        dispatch_source_set_cancel_handler(self.connectingSource) { 
            self.fd.close()
        }
    }
}
        self.loop = loop
        self.socketFD = fd
        
        // Set SO_REUSEADDR
        var reuseAddr = 1
        let error = setsockopt(self.socketFD.rawValue, SOL_SOCKET, SO_REUSEADDR, &reuseAddr, socklen_t(strideof(Int)))
        if error != 0 {
            try! { throw Error(rawValue: error) }()
        }
        
        // Create the dispatch source for listening
        self.channel = dispatch_io_create(DISPATCH_IO_STREAM, fd.rawValue, dispatch_get_main_queue()) { error in
            if error != 0 {
                try! { throw Error(rawValue: error) }()
            }
        }
    }
    
