network

package
v0.0.0-...-128d3dd Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WAITTIME = 5         // seconds
	DMAXSIZE = (2 << 20) // (2^20)*2 = 2MiB
	BUFFSIZE = (4 << 10) // (2^10)*4 = 4KiB
)
View Source
const (
	ENDBYTES = "\000\005\007\001\001\007\005\000"
)

Variables

This section is empty.

Functions

func Handle

func Handle(option int, conn Conn, pack *Package, handle func(*Package) string) bool

func SerializePackage

func SerializePackage(pack *Package) string

Types

type Conn

type Conn net.Conn

type Listener

type Listener net.Listener

func Listen

func Listen(address string, handle func(Conn, *Package)) Listener

type Package

type Package struct {
	Option int
	Data   string
}

func DeserializePackage

func DeserializePackage(data string) *Package

func Send

func Send(address string, pack *Package) *Package

Jump to

Keyboard shortcuts

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