network

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTcpAgent

func NewTcpAgent(addr string, receiver kiwi.FnAgentBytes, options ...kiwi.AgentOption) *tcpAgent

NewTcpAgent receiver接收字节如果使用异步方式需要copy一份,否则数据会被覆盖

func NewTcpDialer

func NewTcpDialer(name, addr string, receiver kiwi.FnAgentBytes, options ...kiwi.AgentOption) kiwi.IDialer

func NewTcpListener

func NewTcpListener(addr string, onConn func(conn net.Conn)) kiwi.IListener

func NewUdpAgent

func NewUdpAgent(addr string, receiver kiwi.FnAgentBytes, options ...kiwi.AgentOption) *udpAgent

func NewUdpDialer

func NewUdpDialer(name, addr string, receiver kiwi.FnAgentBytes, options ...kiwi.AgentOption) kiwi.IDialer

func NewUdpListener

func NewUdpListener(addr string, onConn func(conn net.Conn)) kiwi.IListener

func NewWebAgent

func NewWebAgent(addr string, msgType int, receiver kiwi.FnAgentBytes, options ...kiwi.AgentOption) *webAgent

func NewWebDialer

func NewWebDialer(url string, header http.Header, msgType int, receiver kiwi.FnAgentBytes, options ...kiwi.AgentOption) kiwi.IDialer

func NewWebListener

func NewWebListener(onConn func(conn *websocket.Conn), opts ...WebOption) kiwi.IListener

Types

type WebOption

type WebOption func(option *webOption)

func WebAddr

func WebAddr(addr string) WebOption

func WebResHeader

func WebResHeader(header http.Header) WebOption

func WebUpgrader

func WebUpgrader(fn func(*websocket.Upgrader)) WebOption

Jump to

Keyboard shortcuts

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