예제 #1
0
파일: client.go 프로젝트: ricochet2200/gun
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)
}
예제 #2
0
파일: client.go 프로젝트: ricochet2200/gun
func (this *Client) Bind() (*Connection, error) {

	log.Println("Binding...")
	req := msg.NewRequest(msg.Request | msg.Binding)
	return this.SendReqRes(req)
}