// Copyright 2019 The Gorilla WebSocket Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package websocket

import (
	
	
)

// JoinMessages concatenates received messages to create a single io.Reader.
// The string term is appended to each message. The returned reader does not
// support concurrent calls to the Read method.
func ( *Conn,  string) io.Reader {
	return &joinReader{c: , term: }
}

type joinReader struct {
	c    *Conn
	term string
	r    io.Reader
}

func ( *joinReader) ( []byte) (int, error) {
	if .r == nil {
		var  error
		_, .r,  = .c.NextReader()
		if  != nil {
			return 0, 
		}
		if .term != "" {
			.r = io.MultiReader(.r, strings.NewReader(.term))
		}
	}
	,  := .r.Read()
	if  == io.EOF {
		 = nil
		.r = nil
	}
	return , 
}