Documentation ¶
Index ¶
- Constants
- func UdpShutdown()
- type UdpClient
- func (this *UdpClient) AddCount(packCount, chanCount, sendCount, flushErrCount, errCount int, reset bool)
- func (this *UdpClient) ApplyConfig(conf config.Config)
- func (this *UdpClient) Close()
- func (this *UdpClient) GetLocalAddr() net.Addr
- func (this *UdpClient) Send(p udp.UdpPack)
- func (this *UdpClient) SendRelay(p pack.Pack, flush bool)
- func (this *UdpClient) Shutdown()
- type UdpClientOption
- type UdpData
Constants ¶
View Source
const ( UDP_READ_MAX = 64 * 1024 UDP_PACKET_BUFFER = 64 * 1024 UDP_PACKET_BUFFER_CHUNKED_LIMIT = 48 * 1024 UDP_PACKET_CHANNEL_MAX = 2048 UDP_PACKET_FLUSH_TIMEOUT = 10 * 1000 UDP_PACKET_HEADER_SIZE = 9 // typ pos 0 UDP_PACKET_HEADER_TYPE_POS = 0 // ver pos 1 UDP_PACKET_HEADER_VER_POS = 1 // len pos 5 UDP_PACKET_HEADER_LEN_POS = 5 UDP_PACKET_SQL_MAX_SIZE = 32768 )
Variables ¶
This section is empty.
Functions ¶
func UdpShutdown ¶
func UdpShutdown()
Types ¶
type UdpClient ¶
type UdpClient struct {
// contains filtered or unexported fields
}
func GetUdpClient ¶
func GetUdpClient(opts ...UdpClientOption) *UdpClient
func (*UdpClient) ApplyConfig ¶ added in v0.0.15
implements common.ConfigObserver
func (*UdpClient) GetLocalAddr ¶
type UdpClientOption ¶ added in v0.0.15
type UdpClientOption interface {
// contains filtered or unexported methods
}
func WithConfigObserver ¶ added in v0.0.15
func WithConfigObserver(obj *config.ConfigObserver) UdpClientOption
func WithContext ¶ added in v0.0.15
func WithContext(ctx context.Context, cancel context.CancelFunc) UdpClientOption
func WithLogger ¶ added in v0.0.15
func WithLogger(logger logger.Logger) UdpClientOption
func WithUdpServer ¶ added in v0.0.15
func WithUdpServer(host string, port int) UdpClientOption
Click to show internal directories.
Click to hide internal directories.