cf

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mylog

func Mylog(b bool, v ...interface{})

Mylog my

func SetLimitDownloadSpeed

func SetLimitDownloadSpeed(down uint64, isLimitDown bool)

SetLimitDownloadSpeed

func SetLimitUploadSpeed

func SetLimitUploadSpeed(up uint64, isLimitUpload bool)

SetLimitUploadSpeed

Types

type ClientConn

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

ClientConn

func CreateClientConn

func CreateClientConn(netid int64, c net.Conn, opt ...ClientOption) *ClientConn

CreateClientConn

func (*ClientConn) ClientClose

func (cc *ClientConn) ClientClose()

ClientClose Actively closes the client connection

func (*ClientConn) Close

func (cc *ClientConn) Close()

Close

func (*ClientConn) ContextValue

func (cc *ClientConn) ContextValue(k interface{}) interface{}

ContextValue

func (*ClientConn) GetIP

func (cc *ClientConn) GetIP() string

GetIP get connection ip

func (*ClientConn) GetInboundAndReset added in v0.5.0

func (cc *ClientConn) GetInboundAndReset() int64

func (*ClientConn) GetLocalAddr added in v0.5.0

func (cc *ClientConn) GetLocalAddr() string

func (*ClientConn) GetName

func (cc *ClientConn) GetName() string

GetName

func (*ClientConn) GetNetID

func (cc *ClientConn) GetNetID() int64

GetNetID

func (*ClientConn) GetOutboundAndReset added in v0.5.0

func (cc *ClientConn) GetOutboundAndReset() int64

func (*ClientConn) GetPort

func (cc *ClientConn) GetPort() string

GetPort

func (*ClientConn) GetRemoteAddr added in v0.5.0

func (cc *ClientConn) GetRemoteAddr() string

func (*ClientConn) GetSecondReadFlow

func (cc *ClientConn) GetSecondReadFlow() int64

GetSecondReadFlow

func (*ClientConn) GetSecondWriteFlow

func (cc *ClientConn) GetSecondWriteFlow() int64

GetSecondWriteFlow

func (*ClientConn) SetConnName

func (cc *ClientConn) SetConnName(name string)

SetConnName

func (*ClientConn) SetContextValue

func (cc *ClientConn) SetContextValue(k, v interface{})

SetContextValue

func (*ClientConn) Start

func (cc *ClientConn) Start()

Start client start readLoop, writeLoop, handleLoop

func (*ClientConn) Write

func (cc *ClientConn) Write(message *msg.RelayMsgBuf) error

Write

type ClientOption

type ClientOption func(*options)

ClientOption client configuration

func BufferSizeOption

func BufferSizeOption(indicator int) ClientOption

BufferSizeOption

func HeartCloseOption

func HeartCloseOption(b bool) ClientOption

HeartCloseOption

func LogOpenOption

func LogOpenOption(b bool) ClientOption

LogOpenOption

func OnCloseOption

func OnCloseOption(cb func(core.WriteCloser)) ClientOption

OnCloseOption

func OnConnectOption

func OnConnectOption(cb func(core.WriteCloser) bool) ClientOption

OnConnectOption

func OnErrorOption

func OnErrorOption(cb func(core.WriteCloser)) ClientOption

OnErrorOption

func OnMessageOption

func OnMessageOption(cb func(msg.RelayMsgBuf, core.WriteCloser)) ClientOption

OnMessageOption

func ReconnectOption

func ReconnectOption() ClientOption

ReconnectOption

type MsgHandler

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

MsgHandler

Jump to

Keyboard shortcuts

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