func (this *Client) Authenticate(res, oldReq *msg.Message) (*Connection, error) { req := msg.NewRequest(msg.Request | msg.Binding) req.CopyAttributes(oldReq) r, _ := res.Attribute(msg.Realm) this.realm = r.(*msg.RealmAttr) nonce, _ := res.Attribute(msg.Nonce) this.nonce = nonce.(*msg.NonceAttr) return this.SendReqRes(req) }
func (this *Client) Bind() (*Connection, error) { log.Println("Binding...") req := msg.NewRequest(msg.Request | msg.Binding) return this.SendReqRes(req) }