redo web UI |web close| client log |system info |p2p |max、ump optimization

This commit is contained in:
刘河
2019-03-01 17:23:14 +08:00
parent 534d428c6d
commit f526c56784
82 changed files with 15199 additions and 4561 deletions

View File

@@ -4,7 +4,7 @@ import (
"github.com/cnlh/nps/lib/pool"
"github.com/cnlh/nps/lib/rate"
"github.com/cnlh/nps/vender/github.com/golang/snappy"
"net"
"io"
)
type SnappyConn struct {
@@ -13,7 +13,7 @@ type SnappyConn struct {
rate *rate.Rate
}
func NewSnappyConn(conn net.Conn, crypt bool, rate *rate.Rate) *SnappyConn {
func NewSnappyConn(conn io.ReadWriteCloser, crypt bool, rate *rate.Rate) *SnappyConn {
c := new(SnappyConn)
c.w = snappy.NewBufferedWriter(conn)
c.r = snappy.NewReader(conn)
@@ -48,3 +48,8 @@ func (s *SnappyConn) Read(b []byte) (n int, err error) {
}
return
}
func (s *SnappyConn) Close() error {
s.w.Close()
return s.w.Close()
}