您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

conn_write_legacy.go 398B

123456789101112131415161718
  1. // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // +build !go1.8
  5. package websocket
  6. func (c *Conn) writeBufs(bufs ...[]byte) error {
  7. for _, buf := range bufs {
  8. if len(buf) > 0 {
  9. if _, err := c.conn.Write(buf); err != nil {
  10. return err
  11. }
  12. }
  13. }
  14. return nil
  15. }