mwNet

package
Version: v0.0.0-...-3e0a51a Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EVENT_OBJECT      = 1
	EVENT_RECV_TEXT   = 2
	EVENT_RECV_BINARY = 3
	EVENT_CLOSE       = 4
	EVENT_PING        = 5
	EVENT_PONG        = 6
)
View Source
const (
	CONFIG_IO_BUFFER_SIZE = 4096
)

Variables

This section is empty.

Functions

func Host2IP

func Host2IP(Host string) string

Types

type CBHOOK

type CBHOOK func(Event int, ObjNet *TNet, data []byte)

type Reader

type Reader interface {
	Read(p []byte) (n int, err error)
}

type TIOBuffer

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

func NewIOBuffer

func NewIOBuffer(errObj *mwError.TError, ioObject Reader) *TIOBuffer

func (*TIOBuffer) Buffered

func (self *TIOBuffer) Buffered() int

func (*TIOBuffer) FlushBuffer

func (self *TIOBuffer) FlushBuffer()

func (*TIOBuffer) IsClose

func (self *TIOBuffer) IsClose() bool

func (*TIOBuffer) ReadByte

func (self *TIOBuffer) ReadByte() byte

func (*TIOBuffer) ReadBytes

func (self *TIOBuffer) ReadBytes(Length int) []byte

func (*TIOBuffer) ReadChunk

func (self *TIOBuffer) ReadChunk() []byte

func (*TIOBuffer) ReadLine

func (self *TIOBuffer) ReadLine() string

func (*TIOBuffer) ReadToCBHook

func (self *TIOBuffer) ReadToCBHook(Event int, fn CBHOOK)

func (*TIOBuffer) ReadToEOF

func (self *TIOBuffer) ReadToEOF() []byte

func (*TIOBuffer) WebSocketReadToCBHook

func (self *TIOBuffer) WebSocketReadToCBHook(Event int, fn CBHOOK)

type TNet

type TNet struct {
	ObjError *mwError.TError // Error Object
	Proxy    *mwProxy.TProxy // Proxy Module
	Conn     net.Conn
	// contains filtered or unexported fields
}

func NewNet

func NewNet(errObj *mwError.TError, p *mwProxy.TProxy) *TNet

func (*TNet) Close

func (self *TNet) Close()

func (*TNet) InitTLS

func (self *TNet) InitTLS(conn net.Conn, ServerName string)

func (*TNet) IsIOClosed

func (self *TNet) IsIOClosed() bool

func (*TNet) ReadBytes

func (self *TNet) ReadBytes(Length int) []byte

func (*TNet) ReadChunk

func (self *TNet) ReadChunk() []byte

func (*TNet) ReadLine

func (self *TNet) ReadLine() string

func (*TNet) ReadToEOF

func (self *TNet) ReadToEOF() []byte

func (*TNet) SendPacket

func (self *TNet) SendPacket(Packet []byte)

func (*TNet) SetTimeOut

func (self *TNet) SetTimeOut(TimeOut time.Duration)

func (*TNet) StartNetwork

func (self *TNet) StartNetwork(d net.Dialer, Host string, Port string) net.Conn

func (*TNet) WebSocketReadToCBHook

func (self *TNet) WebSocketReadToCBHook(Event int, fn CBHOOK)

func (*TNet) WebSocketSendClose

func (self *TNet) WebSocketSendClose()

func (*TNet) WebSocketSendPing

func (self *TNet) WebSocketSendPing(Msg []byte)

func (*TNet) WebSocketSendPong

func (self *TNet) WebSocketSendPong(Msg []byte)

func (*TNet) WebSocketSendText

func (self *TNet) WebSocketSendText(Msg string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL