Documentation
¶
Index ¶
- func Mylog(b bool, v ...interface{})
- func SetLimitDownloadSpeed(down uint64, isLimitDown bool)
- func SetLimitUploadSpeed(up uint64, isLimitUpload bool)
- type ClientConn
- func (cc *ClientConn) ClientClose()
- func (cc *ClientConn) Close()
- func (cc *ClientConn) ContextValue(k interface{}) interface{}
- func (cc *ClientConn) GetIP() string
- func (cc *ClientConn) GetInboundAndReset() int64
- func (cc *ClientConn) GetLocalAddr() string
- func (cc *ClientConn) GetName() string
- func (cc *ClientConn) GetNetID() int64
- func (cc *ClientConn) GetOutboundAndReset() int64
- func (cc *ClientConn) GetPort() string
- func (cc *ClientConn) GetRemoteAddr() string
- func (cc *ClientConn) GetSecondReadFlow() int64
- func (cc *ClientConn) GetSecondWriteFlow() int64
- func (cc *ClientConn) SetConnName(name string)
- func (cc *ClientConn) SetContextValue(k, v interface{})
- func (cc *ClientConn) Start()
- func (cc *ClientConn) Write(message *msg.RelayMsgBuf) error
- type ClientOption
- func BufferSizeOption(indicator int) ClientOption
- func HeartCloseOption(b bool) ClientOption
- func LogOpenOption(b bool) ClientOption
- func OnCloseOption(cb func(core.WriteCloser)) ClientOption
- func OnConnectOption(cb func(core.WriteCloser) bool) ClientOption
- func OnErrorOption(cb func(core.WriteCloser)) ClientOption
- func OnMessageOption(cb func(msg.RelayMsgBuf, core.WriteCloser)) ClientOption
- func ReconnectOption() ClientOption
- type MsgHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetLimitDownloadSpeed ¶
SetLimitDownloadSpeed
func SetLimitUploadSpeed ¶
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) ContextValue ¶
func (cc *ClientConn) ContextValue(k interface{}) interface{}
ContextValue
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) GetOutboundAndReset ¶ added in v0.5.0
func (cc *ClientConn) GetOutboundAndReset() int64
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) SetContextValue ¶
func (cc *ClientConn) SetContextValue(k, v interface{})
SetContextValue
func (*ClientConn) Start ¶
func (cc *ClientConn) Start()
Start client start readLoop, writeLoop, handleLoop
type ClientOption ¶
type ClientOption func(*options)
ClientOption client configuration
func OnConnectOption ¶
func OnConnectOption(cb func(core.WriteCloser) bool) ClientOption
OnConnectOption
func OnMessageOption ¶
func OnMessageOption(cb func(msg.RelayMsgBuf, core.WriteCloser)) ClientOption
OnMessageOption
Click to show internal directories.
Click to hide internal directories.