func (s *TrapServer) Stop() {
	stopped := make(chan interface{})

	go func() {
		log.Infof("Stop listening on %s", s.config.Addr())
		s.listener.Close()
		close(stopped)
	}()

	select {
	case <-stopped:
	case <-time.After(time.Duration(s.config.StopTimeout) * time.Second):
		log.Errorf("Stopping server. Timeout after %d seconds", s.config.StopTimeout)
	}

	// Let consumers know that we will not be sending any more packets.
	close(s.packets)
}
// Stop stops the TrapServer.
Stop stops the TrapServer.
// Stop stops the TrapServer .
func (s *TrapServer) Stop() {
	stopped := make(chan interface{})
	go func() {
		log.Infof("Stop listening on %s", s.config.Addr())
		s.listener.Close()
		close(stopped)
	}()
	select {
	case <-stopped:
	case <-time.After(time.Duration(s.config.StopTimeout) * time.Second):
		log.Errorf("Stopping server. Timeout after %d seconds", s.config.StopTimeout)
	}
	close(s.packets)
}
func ( s * TrapServer ) Stop ( ) { stopped := make ( chan interface { } ) go func ( ) { log . Infof ( " " , s . config . Addr ( ) ) s . listener . Close ( ) close ( stopped ) } ( ) select { case <- stopped : case <- time . After ( time . Duration ( s . config . StopTimeout ) * time . Second ) : log . Errorf ( " " , s . config . StopTimeout ) } close ( s . packets ) }
Stop stops the TrapServer.
Stop stops the TrapServer .
// Let consumers know that we will not be sending any more packets.