 //
 //  LightMQTT.swift
 //
-
 import Foundation
 
 fileprivate enum PacketType: UInt8 {

            return result
        }

        public init(port: Int? = nil, pingInterval: UInt16 = 10, useTLS: Bool = false, securityLevel: StreamSocketSecurityLevel = StreamSocketSecurityLevel.tlSv1, networkServiceType: StreamNetworkServiceTypeValue = StreamNetworkServiceTypeValue.background, username: String? = nil, password: String? = nil, clientId: String? = nil, bufferSize: Int = 4096, readQosClass: DispatchQoS.QoSClass = .background) {
            self.port = port
            self.pingInterval = pingInterval
            self.useTLS = useTLS
            self.securityLevel = securityLevel
            self.networkServiceType = networkServiceType
            self.username = username
            self.password = password

        if options.useTLS {
            input.setProperty(options.securityLevel, forKey: .socketSecurityLevelKey)
            output.setProperty(options.securityLevel, forKey: .socketSecurityLevelKey)
        }
        
        if options.allowUntrustCACertificate {
            input.setProperty(false, forKey: kCFStreamSSLValidatesCertificateChain as Stream.PropertyKey)
            output.setProperty(false, forKey: kCFStreamSSLValidatesCertificateChain as Stream.PropertyKey)
        }
        
        input.setProperty(options.networkServiceType, forKey: .networkServiceType)
