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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starpc",
3
- "version": "0.33.5",
3
+ "version": "0.33.6",
4
4
  "description": "Streaming protobuf RPC service protocol over any two-way channel.",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -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.WriteCancel()
108
+ _ = r.WriteCallCancel()
109
109
  }
110
110
 
111
111
  r.bcast.HoldLock(func(broadcast func(), getWaitCh func() <-chan struct{}) {
@@ -173,8 +173,8 @@ func (c *commonRPC) HandleCallData(pkt *CallData) error {
173
173
  return err
174
174
  }
175
175
 
176
- // WriteCancel writes a call cancel packet.
177
- func (c *commonRPC) WriteCancel() error {
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
  }
@@ -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
- _ = r.CloseSend()
81
+ err := r.rw.WriteCallCancel()
79
82
  if r.closeCb != nil {
80
83
  r.closeCb()
81
84
  }
82
85
 
83
- return nil
86
+ return err
84
87
  }
85
88
 
86
89
  // _ is a type assertion