add kcp dialer

This commit is contained in:
ginuerzh
2021-12-16 19:03:56 +08:00
parent 5bd3c25c65
commit a52cd9a4c2
19 changed files with 395 additions and 78 deletions

View File

@ -34,7 +34,8 @@ func (c *tcpConn) Write(b []byte) (n int, err error) {
n = len(b) // force byte length consistent
if c.wbuf.Len() > 0 {
c.wbuf.Write(b) // append the data to the cached header
_, err = c.wbuf.WriteTo(c.Conn)
_, err = c.Conn.Write(c.wbuf.Bytes())
c.wbuf.Reset()
return
}
_, err = c.Conn.Write(b)