Documentation ¶
Index ¶
- type ByteBuffer
- func (b *ByteBuffer) Append(buff ...byte)
- func (b *ByteBuffer) MaxSize() int
- func (b *ByteBuffer) Prepend(buff []byte) bool
- func (b *ByteBuffer) RdBuf() []byte
- func (b *ByteBuffer) RdFlip(size int)
- func (b *ByteBuffer) RdReady() bool
- func (b *ByteBuffer) RdSize() int
- func (b *ByteBuffer) Reset()
- func (b *ByteBuffer) WrBuf() []byte
- func (b *ByteBuffer) WrFlip(size int)
- func (b *ByteBuffer) WrGrow(size int)
- func (b *ByteBuffer) WrSize() int
- type Session
- func (s *Session) Close() bool
- func (s *Session) GetID() int64
- func (s *Session) GetTag() interface{}
- func (s *Session) IsClosed() bool
- func (s *Session) RemoteAddr() string
- func (s *Session) Reply(header *fnet.Message, msg interface{}, status uint8) bool
- func (s *Session) Request(msg interface{}, status, serializeType uint8, indexId uint32) bool
- func (s *Session) SetID(id int64)
- func (s *Session) SetTag(tag interface{})
- func (s *Session) Start()
- type TcpClient
- func (t *TcpClient) AddCloseHandler(f fnet.OnCloseFunc)
- func (t *TcpClient) AddConnectHandler(f fnet.OnConnectFunc)
- func (t *TcpClient) GetID() int64
- func (t *TcpClient) IsRunning() bool
- func (t *TcpClient) Reply(header *fnet.Message, msg interface{}, status uint8) bool
- func (t *TcpClient) Run()
- func (t *TcpClient) Send(msg interface{}, status uint8) bool
- func (t *TcpClient) SetRunning(v bool)
- func (t *TcpClient) Stop()
- type TcpServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByteBuffer ¶
type ByteBuffer struct {
// contains filtered or unexported fields
}
func NewByteBuffer ¶
func NewByteBuffer() *ByteBuffer
func (*ByteBuffer) Append ¶
func (b *ByteBuffer) Append(buff ...byte)
func (*ByteBuffer) MaxSize ¶
func (b *ByteBuffer) MaxSize() int
func (*ByteBuffer) Prepend ¶
func (b *ByteBuffer) Prepend(buff []byte) bool
func (*ByteBuffer) RdBuf ¶
func (b *ByteBuffer) RdBuf() []byte
func (*ByteBuffer) RdFlip ¶
func (b *ByteBuffer) RdFlip(size int)
func (*ByteBuffer) RdReady ¶
func (b *ByteBuffer) RdReady() bool
func (*ByteBuffer) RdSize ¶
func (b *ByteBuffer) RdSize() int
func (*ByteBuffer) Reset ¶
func (b *ByteBuffer) Reset()
func (*ByteBuffer) WrBuf ¶
func (b *ByteBuffer) WrBuf() []byte
func (*ByteBuffer) WrFlip ¶
func (b *ByteBuffer) WrFlip(size int)
func (*ByteBuffer) WrGrow ¶
func (b *ByteBuffer) WrGrow(size int)
func (*ByteBuffer) WrSize ¶
func (b *ByteBuffer) WrSize() int
type Session ¶
type Session struct { Conn *net.TCPConn HeartTime time.Time OnClose func() // 关闭函数回调 // contains filtered or unexported fields }
func NewSession ¶
func (*Session) RemoteAddr ¶
type TcpClient ¶
type TcpClient struct { Address string Tag string SerializeType fnet.SerializeType // contains filtered or unexported fields }
func NewTcpClient ¶
func (*TcpClient) AddCloseHandler ¶
func (t *TcpClient) AddCloseHandler(f fnet.OnCloseFunc)
func (*TcpClient) AddConnectHandler ¶
func (t *TcpClient) AddConnectHandler(f fnet.OnConnectFunc)
func (*TcpClient) SetRunning ¶
type TcpServer ¶
type TcpServer struct {
// contains filtered or unexported fields
}
func NewDefaultTcpServer ¶
func NewTcpServer ¶
func (*TcpServer) AddCloseHandler ¶
func (t *TcpServer) AddCloseHandler(f fnet.OnCloseFunc)
func (*TcpServer) AddConnectHandler ¶
func (t *TcpServer) AddConnectHandler(f fnet.OnConnectFunc)
func (*TcpServer) SetBeforeExit ¶
func (t *TcpServer) SetBeforeExit(f func())
Click to show internal directories.
Click to hide internal directories.