MCPcopy Create free account
hub / github.com/XTLS/Go / write

Method write

conn.go:1015–1024  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

1013}
1014
1015func (c *Conn) write(data []byte) (int, error) {
1016 if c.buffering {
1017 c.sendBuf = append(c.sendBuf, data...)
1018 return len(data), nil
1019 }
1020
1021 n, err := c.conn.Write(data)
1022 c.bytesSent += int64(n)
1023 return n, err
1024}
1025
1026func (c *Conn) flush() (int, error) {
1027 if len(c.sendBuf) == 0 {

Callers 1

writeRecordLockedMethod · 0.95

Calls 1

WriteMethod · 0.45

Tested by

no test coverage detected