func (cpl *CarbonPlaintextListener) getTCPData(conn net.Conn) {
	defer conn.Close()
	defer config.G.Log.System.LogDebug("CarbonTCP connection closed")
	config.G.Log.System.LogDebug("CarbonTCP connection accepted")
	scanner := bufio.NewScanner(conn)
	for scanner.Scan() {
		cpl.metricHandler(scanner.Text())
	}
}
getTCPData reads a line from a TCP connection and dispatches it.
package listener
import (
	"bufio"
	"bytes"
	"encoding/json"
	"net"
	"regexp"
	"strconv"
	"strings"
	"sync"
	"time"
	"github.com/jeffpierce/cassabon/config"
	"github.com/jeffpierce/cassabon/logging"
)
type CarbonPlaintextListener struct {
	listen   string
	peers    map[string]string
	wg       *sync.WaitGroup
	peerMsg  *regexp.Regexp
	peerList PeerList
}
func (cpl *CarbonPlaintextListener) Init() {
	cpl.listen = config.G.Carbon.Listen
	cpl.peers = config.G.Carbon.Peers
	cpl.peerMsg = regexp.MustCompile("^<<([a-z]+)=(.*)>>$")  
	cpl.peerList = PeerList{}
	cpl.peerList.Init()
}
func (cpl *CarbonPlaintextListener) Start(wg, dependentWG *sync.WaitGroup) {
	cpl.wg = wg
	if cpl.peerList.IsStarted() &&
		!cpl.peerList.IsEqual(cpl.listen, cpl.peers) {
		config.G.Log.System.LogDebug("peerList::isEqual(): false")
		config.G.OnPeerChangeReq <- struct{}{}  
		<-config.G.OnPeerChangeRsp              
	}
	cpl.peerList.Start(dependentWG, cpl.listen, cpl.peers)
	cpl.peerList.PropagatePeerList()
	switch config.G.Carbon.Protocol {
	case "tcp":
		cpl.wg.Add(1)
		go cpl.carbonTCP(cpl.listen)
	case "udp":
		cpl.wg.Add(1)
		go cpl.carbonUDP(cpl.listen)
	default:
		cpl.wg.Add(2)
		go cpl.carbonTCP(cpl.listen)
		go cpl.carbonUDP(cpl.listen)
	}
}
func (cpl *CarbonPlaintextListener) carbonTCP(hostPort string) {
	defer config.G.OnPanic()
	tcpaddr, _ := net.ResolveTCPAddr("tcp4", hostPort)
	tcpListener, err := net.ListenTCP("tcp4", tcpaddr)
	if err != nil {
		config.G.Log.System.LogFatal("Cannot listen for Carbon on TCP: %s", err.Error())
	}
	defer tcpListener.Close()
	config.G.Log.System.LogInfo("Listening on %s TCP for Carbon plaintext protocol", tcpListener.Addr().String())
	for {
		select {
		case <-config.G.OnReload1:
			config.G.Log.System.LogDebug("CarbonTCP received QUIT message")
			cpl.wg.Done()
			return
		default:
			tcpListener.SetDeadline(time.Now().Add(time.Duration(config.G.Carbon.Parameters.TCPTimeout) * time.Second))
			if conn, err := tcpListener.Accept(); err == nil {
				select {
				case <-config.G.OnReload1:
					conn.Close()  
				default:
					go cpl.getTCPData(conn)
				}
			} else {
				if err.(net.Error).Timeout() {
					config.G.Log.System.LogDebug("CarbonTCP Accept() timed out")
				} else {
					config.G.Log.System.LogWarn("CarbonTCP Accept() error: %s", err.Error())
					logging.Statsd.Client.Inc("carbon.err.tcp", 1, 1.0)
				}
			}
		}
	}
}