starpc 0.33.5 → 0.33.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/srpc/client-rpc.go +1 -1
- package/srpc/common-rpc.go +2 -2
- package/srpc/msg-stream.go +5 -2
package/package.json
CHANGED
package/srpc/client-rpc.go
CHANGED
|
@@ -105,7 +105,7 @@ func (r *ClientRPC) HandleCallStart(pkt *CallStart) error {
|
|
|
105
105
|
// Close releases any resources held by the ClientRPC.
|
|
106
106
|
func (r *ClientRPC) Close() {
|
|
107
107
|
if r.writer != nil {
|
|
108
|
-
_ = r.
|
|
108
|
+
_ = r.WriteCallCancel()
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
r.bcast.HoldLock(func(broadcast func(), getWaitCh func() <-chan struct{}) {
|
package/srpc/common-rpc.go
CHANGED
|
@@ -173,8 +173,8 @@ func (c *commonRPC) HandleCallData(pkt *CallData) error {
|
|
|
173
173
|
return err
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
//
|
|
177
|
-
func (c *commonRPC)
|
|
176
|
+
// WriteCallCancel writes a call cancel packet.
|
|
177
|
+
func (c *commonRPC) WriteCallCancel() error {
|
|
178
178
|
if c.writer != nil {
|
|
179
179
|
return c.writer.WritePacket(NewCallCancelPacket())
|
|
180
180
|
}
|
package/srpc/msg-stream.go
CHANGED
|
@@ -13,6 +13,9 @@ type MsgStreamRw interface {
|
|
|
13
13
|
|
|
14
14
|
// WriteCallData writes a call data packet.
|
|
15
15
|
WriteCallData(data []byte, complete bool, err error) error
|
|
16
|
+
|
|
17
|
+
// WriteCallCancel writes a call cancel (close) packet.
|
|
18
|
+
WriteCallCancel() error
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
// MsgStream implements the stream interface passed to implementations.
|
|
@@ -75,12 +78,12 @@ func (r *MsgStream) CloseSend() error {
|
|
|
75
78
|
|
|
76
79
|
// Close closes the stream.
|
|
77
80
|
func (r *MsgStream) Close() error {
|
|
78
|
-
|
|
81
|
+
err := r.rw.WriteCallCancel()
|
|
79
82
|
if r.closeCb != nil {
|
|
80
83
|
r.closeCb()
|
|
81
84
|
}
|
|
82
85
|
|
|
83
|
-
return
|
|
86
|
+
return err
|
|
84
87
|
}
|
|
85
88
|
|
|
86
89
|
// _ is a type assertion
|