tcp

package
v1.9.42 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 17 Imported by: 16

Documentation

Index

Constants

View Source
const (
	UDP4   = "udp4"
	SEND   = "send"
	RECV   = "recv"
	ECHO   = "echo"
	DONE   = "done"
	DIRECT = "direct"
)
View Source
const (
	LOCALHOST   = "localhost"
	MAC_ADDRESS = "mac-address"
	MASK        = "mask"

	DOMAIN  = "domain"
	GATEWAY = "gateway"
	MACHINE = "machine"
	ISLOCAL = "islocal"
	PUBLISH = "publish"
)
View Source
const (
	PORT_22   = "22"
	PORT_80   = "80"
	PORT_443  = "443"
	PORT_9020 = "9020"
	PORT_9022 = "9022"

	SOCKET  = "socket"
	BEGIN   = "begin"
	CURRENT = "current"
	RANDOM  = "random"
	END     = "end"
	PID     = "pid"
	SPACE   = "space"
)
View Source
const (
	PROTOCOL  = "protocol"
	HOSTPORT  = "hostport"
	HOSTNAME  = "hostname"
	NODENAME  = "nodename"
	NODETYPE  = "nodetype"
	BANDWIDTH = "bandwidth"
	ADDRESS   = "address"
)
View Source
const (
	PROTO  = "proto"
	STATUS = "status"
	ERROR  = "error"
	START  = "start"
	OPEN   = "open"
	CLOSE  = "close"
	STOP   = "stop"
)
View Source
const (
	LISTEN = "listen"
	UNIX   = "unix"
)
View Source
const CLIENT = "client"
View Source
const (
	DIAL = "dial"
)
View Source
const HOST = "host"
View Source
const PORT = "port"
View Source
const SERVER = "server"
View Source
const (
	SSID = "ssid"
)
View Source
const TCP = "tcp"
View Source
const WIFI = "wifi"

Variables

View Source
var Index = &ice.Context{Name: TCP, Help: "通信模块"}

Functions

func HostPort added in v1.5.5

func HostPort(host, port string) string

func IsLocalHost

func IsLocalHost(m *ice.Message, ip string) bool

func PortCmds added in v1.9.5

func PortCmds(m *ice.Message, arg ...string)

func PortRight added in v1.8.4

func PortRight(m *ice.Message, arg ...string) string

func Prefix added in v1.5.5

func Prefix(arg ...ice.Any) string

func PublishLocalhost added in v1.4.4

func PublishLocalhost(m *ice.Message, url string) string

func UDPAddr added in v1.5.5

func UDPAddr(m *ice.Message, host, port string) *net.UDPAddr

Types

type Buf added in v1.5.5

type Buf struct {
	// contains filtered or unexported fields
}

type Conn

type Conn struct {
	net.Conn
	// contains filtered or unexported fields
}

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) Read

func (c *Conn) Read(b []byte) (int, error)

func (*Conn) Write

func (c *Conn) Write(b []byte) (int, error)

type Listener

type Listener struct {
	net.Listener
	// contains filtered or unexported fields
}

func (Listener) Accept

func (l Listener) Accept() (net.Conn, error)

func (Listener) Close

func (l Listener) Close() error

type PeekConn added in v1.5.5

type PeekConn struct {
	net.Conn
	*Buf
}

func NewPeekConn added in v1.5.5

func NewPeekConn(c net.Conn) PeekConn

func (PeekConn) IsHTTP added in v1.5.5

func (s PeekConn) IsHTTP() bool

func (PeekConn) Peek added in v1.5.5

func (s PeekConn) Peek(n int) (res []byte)

func (PeekConn) Read added in v1.5.5

func (s PeekConn) Read(b []byte) (n int, err error)

func (PeekConn) Redirect added in v1.5.5

func (s PeekConn) Redirect(status int, location string)

type Stat

type Stat struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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