Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type OnReadHandler ¶
type OnReadHandler func(reader *iox.OctetsReader, err error)
type Route ¶
Route struct
type ScanDefender ¶
type ScanDefender struct {
// contains filtered or unexported fields
}
ScanDefender 用于检测和防御基于IP的扫描行为
func (*ScanDefender) IsScanner ¶
func (my *ScanDefender) IsScanner(ip string) bool
IsScanner 记录一个新的连接并返回是否是扫描器
func (*ScanDefender) OnSessionClosed ¶
func (my *ScanDefender) OnSessionClosed(ip string)
func (*ScanDefender) OnSessionHandShaken ¶
func (my *ScanDefender) OnSessionHandShaken(ip string)
type TcpLink ¶
type TcpLink struct {
// contains filtered or unexported fields
}
func NewTcpLink ¶
func (*TcpLink) Close ¶
func (my *TcpLink) Close() error
Close closes the connection. Any blocked Read or Write operations will be unblocked and return errors.
func (*TcpLink) GoLoop ¶
func (my *TcpLink) GoLoop(kickInterval time.Duration, onReadHandler OnReadHandler)
func (*TcpLink) RemoteAddr ¶
RemoteAddr returns the remote address.
type WsLink ¶
type WsLink struct {
// contains filtered or unexported fields
}
func (*WsLink) Close ¶
func (my *WsLink) Close() error
Close closes the connection. Any blocked Read or Write operations will be unblocked and return errors.
func (*WsLink) GoLoop ¶
func (my *WsLink) GoLoop(kickInterval time.Duration, onReadHandler OnReadHandler)
func (*WsLink) RemoteAddr ¶
RemoteAddr returns the remote address.
Click to show internal directories.
Click to hide internal directories.