tcp

package
v1.5.23 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: MIT Imports: 14 Imported by: 16

Documentation

Index

Constants

View Source
const (
	UDP4 = "udp4"
	SEND = "send"
	RECV = "recv"
)
View Source
const (
	LOCALHOST = "localhost"

	ISLOCAL = "islocal"
	PUBLISH = "publish"
	GATEWAY = "gateway"
)
View Source
const (
	BEGIN   = "begin"
	CURRENT = "current"
	RANDOM  = "random"
	END     = "end"
)
View Source
const (
	PROTOCOL = "protocol"
	HOSTPORT = "hostport"
	HOSTNAME = "hostname"
	NODENAME = "nodename"
)
View Source
const (
	PROTO  = "proto"
	STATUS = "status"
	ERROR  = "error"
	START  = "start"
	OPEN   = "open"
	CLOSE  = "close"
	STOP   = "stop"
)
View Source
const CLIENT = "client"
View Source
const (
	DIAL = "dial"
)
View Source
const HOST = "host"
View Source
const (
	LISTEN = "listen"
)
View Source
const PORT = "port"
View Source
const SERVER = "server"
View Source
const TCP = "tcp"

Variables

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

Functions

func Address added in v1.5.13

func Address(host, port string) string

func HostPort added in v1.5.5

func HostPort(host, port string) string

func IsLocalHost

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

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