         
         try! self.xmppStream.connect(withTimeout: XMPPStreamTimeoutNone)
     }
-
+    
     public func disconnect(){
         goOffline()
         self.xmppStream.disconnect()

        let msg = XMPPMessage(type: "chat", to: senderJID)
        
        msg?.addBody(message)
        self.xmppStream.send(msg)
        
    }
    


open class XMPPConnection:NSObject{
    var xmppStream: XMPPStream
    
    let hostName: String
    let userJID: XMPPJID
    let hostPort: UInt16
    let password: String
    
    var xmppDelegate:XMPPDelegate?
    
    
    public init(hostName: String, userJIDString: String, hostPort: UInt16 = 5222, password: String, delegate:XMPPDelegate) {
        
        self.hostName = hostName
        self.hostPort = hostPort
        self.password = password
        
        let userJID = XMPPJID(string: userJIDString)
        
        self.xmppStream = XMPPStream()
