conn_write_legacy.go 398 B

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. }