Darien Raymond 7 年之前
父节点
当前提交
18f3fb5196
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      transport/internet/kcp/connection.go

+ 3 - 0
transport/internet/kcp/connection.go

@@ -343,6 +343,9 @@ func (c *Connection) waitForDataOutput() error {
 
 // Write implements io.Writer.
 func (c *Connection) Write(b []byte) (int, error) {
+	// This involves multiple copies of the buffer. But we don't expect this method to be used often.
+	// Only wrapped connections such as TLS and WebSocket will call into this.
+	// TODO: improve effeciency.
 	var mb buf.MultiBuffer
 	common.Must2(mb.Write(b))
 	if err := c.WriteMultiBuffer(mb); err != nil {