ing
This commit is contained in:
parent
1092f7a7ae
commit
dcc3af0723
|
@ -279,7 +279,8 @@ LOOP:
|
||||||
logging.Logger().Debug(err)
|
logging.Logger().Debug(err)
|
||||||
continue LOOP
|
continue LOOP
|
||||||
}
|
}
|
||||||
if nil == resCodec.ID() {
|
|
||||||
|
if resCodec.IsNotification() {
|
||||||
// notification
|
// notification
|
||||||
notiCodec, err := resCodec.Notification()
|
notiCodec, err := resCodec.Notification()
|
||||||
if nil != err {
|
if nil != err {
|
||||||
|
|
|
@ -7,6 +7,7 @@ type ClientCodec interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
type ClientResponseCodec interface {
|
type ClientResponseCodec interface {
|
||||||
|
IsNotification() bool
|
||||||
Notification() (ClientNotificationCodec, error)
|
Notification() (ClientNotificationCodec, error)
|
||||||
Result(result interface{}) error
|
Result(result interface{}) error
|
||||||
Error() *Error
|
Error() *Error
|
||||||
|
|
|
@ -42,6 +42,13 @@ func (crc *ClientResponseCodec) Error() *protocol.Error {
|
||||||
return crc.res.Error
|
return crc.res.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (crc *ClientResponseCodec) IsNotification() bool {
|
||||||
|
if nil == crc.res.ID && nil != crc.res.Result {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func (crc *ClientResponseCodec) Notification() (protocol.ClientNotificationCodec, error) {
|
func (crc *ClientResponseCodec) Notification() (protocol.ClientNotificationCodec, error) {
|
||||||
if nil != crc.res.ID || nil == crc.res.Result {
|
if nil != crc.res.ID || nil == crc.res.Result {
|
||||||
return nil, fmt.Errorf("This is not notification")
|
return nil, fmt.Errorf("This is not notification")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user