Documentation ¶
Index ¶
- Variables
- func BytesMD5(data []byte) string
- func DetectPort(addrStr string, fn func(addr *Addr, port int) (interface{}, error)) (interface{}, error)
- func FileExists(name string) bool
- func FileSize(name string) int64
- func GetRemoteAddress(ses void.Session) (string, bool)
- func IsEOFOrNetReadError(err error) bool
- func JoinAddress(host string, port int) string
- func Pack(writer io.Writer, data interface{}) error
- func ReadFileLines(filename string, callback func(line string) bool) error
- func SplitAddress(addr string) (host string, port int, err error)
- func StringHash(s string) (hash uint16)
- func StringMD5(s string) string
- func Unpack(reader io.Reader, maxPacketSize int) (msg interface{}, err error)
- func WriteFull(writer io.Writer, buf []byte) error
- type Addr
- type RemoteAddr
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMaxPacket = errors.New("packet over size") ErrMinPacket = errors.New("packet short size") ErrShortMsgID = errors.New("short msgid") )
View Source
var (
ErrInvalidPortRange = errors.New("invalid port range")
)
Functions ¶
func DetectPort ¶
func ReadFileLines ¶
读取文本文件的所有行
func SplitAddress ¶
将普通地址格式(host:port)拆分
func StringHash ¶
Types ¶
type Addr ¶
func (*Addr) HostPortString ¶
HostPortString return host:port
type RemoteAddr ¶
修复ws没有实现所有net.conn方法,导致无法获取客服端地址问题.
Click to show internal directories.
Click to hide internal directories.