func (l *NamedPipeListener) Listen() {
	go l.connections.handleConnections()
	for {
		conn, err := l.pipe.Accept()
		switch {
		case err == nil:
			l.connections.newConn <- conn
			buffer := l.packetManager.CreateBuffer()
			go l.listenConnection(conn, buffer)

		case err.Error() == "use of closed network connection":
			{
				// Called when the pipe listener is closed from Stop()
				log.Debug("dogstatsd-named-pipes: stop listening")
				return
			}
		default:
			log.Error(err)
		}
	}
}
// Listen runs the intake loop. Should be called in its own goroutine
Listen runs the intake loop. Should be called in its own goroutine
// Listen runs the intake loop . Should be called in its own goroutine
func (l *NamedPipeListener) Listen() {
	go l.connections.handleConnections()
	for {
		conn, err := l.pipe.Accept()
		switch {
		case err == nil:
			l.connections.newConn <- conn
			buffer := l.packetManager.CreateBuffer()
			go l.listenConnection(conn, buffer)
		case err.Error() == "use of closed network connection":
			{
				log.Debug("dogstatsd-named-pipes: stop listening")
				return
			}
		default:
			log.Error(err)
		}
	}
}
func ( l * NamedPipeListener ) Listen ( ) { go l . connections . handleConnections ( ) for { conn , err := l . pipe . Accept ( ) switch { case err == nil : l . connections . newConn <- conn buffer := l . packetManager . CreateBuffer ( ) go l . listenConnection ( conn , buffer ) case err . Error ( ) == " " : { log . Debug ( " " ) return } default : log . Error ( err ) } } }
Listen runs the intake loop.
Listen runs the intake loop .
// Called when the pipe listener is closed from Stop()