Use CloseRead and CloseWrites

This commit is contained in:
9seconds
2021-12-01 10:37:31 +03:00
parent 7b1f86b75d
commit ffad717829
32 changed files with 320 additions and 99 deletions
+5 -4
View File
@@ -4,12 +4,13 @@ import (
"bytes"
"context"
"io"
"net"
"sync"
"github.com/9seconds/mtg/v2/essentials"
)
type connTraffic struct {
net.Conn
essentials.Conn
streamID string
stream EventStream
@@ -37,7 +38,7 @@ func (c connTraffic) Write(b []byte) (int, error) {
}
type connRewind struct {
net.Conn
essentials.Conn
active io.Reader
buf bytes.Buffer
@@ -58,7 +59,7 @@ func (c *connRewind) Rewind() {
c.active = io.MultiReader(&c.buf, c.Conn)
}
func newConnRewind(conn net.Conn) *connRewind {
func newConnRewind(conn essentials.Conn) *connRewind {
rv := &connRewind{
Conn: conn,
}