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

Method flush

conn.go:1026–1036  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1024}
1025
1026func (c *Conn) flush() (int, error) {
1027 if len(c.sendBuf) == 0 {
1028 return 0, nil
1029 }
1030
1031 n, err := c.conn.Write(c.sendBuf)
1032 c.bytesSent += int64(n)
1033 c.sendBuf = nil
1034 c.buffering = false
1035 return n, err
1036}
1037
1038// outBufPool pools the record-sized scratch buffers used by writeRecordLocked.
1039var outBufPool = sync.Pool{

Callers 6

handshakeContextMethod · 0.95
handshakeMethod · 0.80
handshakeMethod · 0.80
handshakeMethod · 0.80
handshakeMethod · 0.80
doFullHandshakeMethod · 0.80

Calls 1

WriteMethod · 0.45

Tested by

no test coverage detected