Helps determine efficiency of the routine.
c.Interested = interested
}
+var connectionWriterFlush = expvar.NewInt("connectionWriterFlush")
+var connectionWriterWrite = expvar.NewInt("connectionWriterWrite")
+
// Writes buffers to the socket from the write channel.
func (conn *connection) writer() {
// Reduce write syscalls.
if !ok {
return
}
+ connectionWriterWrite.Add(1)
_, err := buf.Write(b)
if err != nil {
conn.Close()
case <-conn.closing:
return
case <-notEmpty:
+ connectionWriterFlush.Add(1)
err := buf.Flush()
if err != nil {
return