Пример #1
0
func (c *Client) SendFlow(f *flow.Flow) error {
	data, err := f.GetData()
	if err != nil {
		return err
	}

	c.connection.Write(data)

	return nil
}
Пример #2
0
func (c *Client) SendFlow(f *flow.Flow) error {
	data, err := f.GetData()
	if err != nil {
		return err
	}

retry:
	_, err = c.connection.Write(data)
	if err != nil {
		logging.GetLogger().Errorf("flows connection to analyzer error %s : try to reconnect" + err.Error())
		c.connection.Close()
		c.connect()
		goto retry
	}

	return nil
}