func (c *RawTCPServerConfiguration) NewServerOptions(
	instrumentOpts instrument.Options,
) rawtcp.Options {
	opts := rawtcp.NewOptions().SetInstrumentOptions(instrumentOpts)
	serverOpts := xserver.NewOptions().
		SetInstrumentOptions(instrumentOpts).
		SetRetryOptions(c.Retry.NewOptions(instrumentOpts.MetricsScope()))
	if c.KeepAliveEnabled != nil {
		serverOpts = serverOpts.SetTCPConnectionKeepAlive(*c.KeepAliveEnabled)
	}
	if c.KeepAlivePeriod != nil {
		serverOpts = serverOpts.SetTCPConnectionKeepAlivePeriod(*c.KeepAlivePeriod)
	}
	opts = opts.SetServerOptions(serverOpts)
	msgpackItOpts := c.MsgpackIterator.NewOptions(instrumentOpts)
	opts = opts.SetMsgpackUnaggregatedIteratorOptions(msgpackItOpts)
	protobufItOpts := c.ProtobufIterator.NewOptions(instrumentOpts)
	opts = opts.SetProtobufUnaggregatedIteratorOptions(protobufItOpts)
	if c.ReadBufferSize != nil {
		opts = opts.SetReadBufferSize(*c.ReadBufferSize)
	}
	if c.ErrorLogLimitPerSecond != nil {
		opts = opts.SetErrorLogLimitPerSecond(*c.ErrorLogLimitPerSecond)
	}
	return opts
}
NewServerOptions create a new set of raw TCP server options.
package config
import (
	"time"
	"github.com/m3db/m3aggregator/server/http"
	"github.com/m3db/m3aggregator/server/rawtcp"
	"github.com/m3db/m3metrics/encoding/msgpack"
	"github.com/m3db/m3metrics/encoding/protobuf"
	"github.com/m3db/m3x/instrument"
	"github.com/m3db/m3x/pool"
	"github.com/m3db/m3x/retry"
	xserver "github.com/m3db/m3x/server"
)
type RawTCPServerConfiguration struct {
	ListenAddress string `yaml:"listenAddress" validate:"nonzero"`
	ErrorLogLimitPerSecond *int64 `yaml:"errorLogLimitPerSecond"`
	KeepAliveEnabled *bool `yaml:"keepAliveEnabled"`
	KeepAlivePeriod *time.Duration `yaml:"keepAlivePeriod"`
	Retry retry.Configuration `yaml:"retry"`
	ReadBufferSize *int `yaml:"readBufferSize"`
	MsgpackIterator msgpackUnaggregatedIteratorConfiguration `yaml:"msgpackIterator"`
	ProtobufIterator protobufUnaggregatedIteratorConfiguration `yaml:"protobufIterator"`
}