Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Commit

Permalink
support calling Start and Stop over and over
Browse files Browse the repository at this point in the history
  • Loading branch information
Dieterbe committed Dec 30, 2016
1 parent d40e06e commit 5eac470
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions input/carbon/carbon.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,19 +117,21 @@ func New() *Carbon {
addrStr: addr,
addr: addrT,
schemas: schemas,
quit: make(chan struct{}),
connTrack: NewConnTrack(),
}
}

func (c *Carbon) Start(metrics mdata.Metrics, metricIndex idx.MetricIndex, usg *usage.Usage) {
c.Input = input.New(metrics, metricIndex, usg, "carbon")
if c.Input.MsgsAge == nil {
c.Input = input.New(metrics, metricIndex, usg, "carbon")
}
l, err := net.ListenTCP("tcp", c.addr)
if nil != err {
log.Fatal(4, "carbon-in: %s", err.Error())
}
c.listener = l
log.Info("carbon-in: listening on %v/tcp", c.addr)
c.quit = make(chan struct{})
go c.accept()
}

Expand Down

0 comments on commit 5eac470

Please sign in to comment.