net

package
v0.1.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2022 License: Apache-2.0 Imports: 11 Imported by: 4

Documentation

Overview

github.com/whatap/go-api/common/net

Index

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          = 255
	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() *UdpClient

func (*UdpClient) Close

func (this *UdpClient) Close()

func (*UdpClient) GetLocalAddr

func (this *UdpClient) GetLocalAddr() net.Addr

func (*UdpClient) Send

func (this *UdpClient) Send(p udp.UdpPack)

func (*UdpClient) SendRelay

func (this *UdpClient) SendRelay(p pack.Pack, flush bool)

func (*UdpClient) Shutdown

func (this *UdpClient) Shutdown()

type UdpData

type UdpData struct {
	Type  byte
	Ver   int32
	Data  []byte
	Flush bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL