xtaci / smux

A Stream Multiplexing Library for golang with least memory usage(TDMA)
MIT License
1.31k stars 196 forks source link

add stream.Cancel(error) method for ability to send error on another side #73

Closed sintanial closed 4 years ago

sintanial commented 4 years ago

Added stream.Cancel(error) method for ability to send error on another side

Sometimes you need to understand reason of why a particular stream was closed by another side This is useful for both: tests and business logic.

If there is a suggestion on how to improve or ideas on how to pass an error interface instead of string, I’m ready to fix it ;)

codecov[bot] commented 4 years ago

Codecov Report

Merging #73 into master will decrease coverage by 3.63%. The diff coverage is 18.60%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #73      +/-   ##
==========================================
- Coverage   83.47%   79.83%   -3.64%     
==========================================
  Files           6        6              
  Lines         708      744      +36     
==========================================
+ Hits          591      594       +3     
- Misses         97      121      +24     
- Partials       20       29       +9     
Impacted Files Coverage Δ
session.go 77.56% <16.66%> (-2.51%) :arrow_down:
stream.go 78.01% <19.35%> (-5.71%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 637399a...ca58d01. Read the comment docs.