Documentation ¶
Index ¶
- func CreateChan() (chan *TData, uint64)
- func DeleteChan(nIndex uint64)
- func FindChan(nIndex uint64) chan *TData
- func RangeConnection(f func(key, value interface{}) bool)
- type IConn
- type TConnection
- func (self *TConnection) Close() error
- func (self *TConnection) GetConn() IConn
- func (self *TConnection) GetIndex() uint64
- func (self *TConnection) LocalAddr() net.Addr
- func (self *TConnection) Read(b []byte) (int, error)
- func (self *TConnection) RemoteAddr() net.Addr
- func (self *TConnection) SetDeadline(t time.Time) error
- func (self *TConnection) SetReadDeadline(t time.Time) error
- func (self *TConnection) Write(buff []byte) (int, error)
- func (self *TConnection) WritePack(buff []byte) (int, error)
- type TData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RangeConnection ¶ added in v1.0.3
func RangeConnection(f func(key, value interface{}) bool)
RangeConnection 遍历
Types ¶
type IConn ¶
type IConn interface { Read(b []byte) (int, error) Write(buff []byte) (int, error) LocalAddr() net.Addr RemoteAddr() net.Addr SetDeadline(t time.Time) error SetReadDeadline(t time.Time) error Close() error }
IConn 连接接口
type TConnection ¶
type TConnection struct {
// contains filtered or unexported fields
}
TConnection 上下文会话
func (*TConnection) LocalAddr ¶
func (self *TConnection) LocalAddr() net.Addr
LocalAddr 本地socket端口地址
func (*TConnection) RemoteAddr ¶
func (self *TConnection) RemoteAddr() net.Addr
RemoteAddr 远程socket端口地址
func (*TConnection) SetDeadline ¶
func (self *TConnection) SetDeadline(t time.Time) error
SetDeadline 设置超时时间 t = 0 意味着I/O操作不会超时。
func (*TConnection) SetReadDeadline ¶
func (self *TConnection) SetReadDeadline(t time.Time) error
SetReadDeadline 设置读取的超时时间 t = 0 意味着I/O操作不会超时。
Click to show internal directories.
Click to hide internal directories.