Documentation ¶
Index ¶
Constants ¶
View Source
const (
MaxHeartBeatIntervalMs = 5 * 1000 // 60s
)
Variables ¶
This section is empty.
Functions ¶
func DialTcpServer ¶
Types ¶
type ClientServerMsg ¶
type ClientServerMsg struct { Session *TcpSession netType.NetMsg }
func NewClientServerMsg ¶
func NewClientServerMsg(sessionPtr *TcpSession, msg *netType.NetMsg) *ClientServerMsg
type TcpClient ¶
type TcpClient struct { Name string // contains filtered or unexported fields }
func (*TcpClient) GetReceiveMsgChan ¶
func (this *TcpClient) GetReceiveMsgChan() chan *ClientServerMsg
type TcpServer ¶
type TcpServer struct { ReceiveMsgChan chan *ClientServerMsg // Out message channel needs to be referenced by the outside world AcceptSessionChan chan *TcpSession // Accept session channel needs to be referenced by the outside world // contains filtered or unexported fields }
func NewTcpServer ¶
type TcpSession ¶
type TcpSession struct { ID uint32 ReceiveMsgChan chan *ClientServerMsg // Referenced external out message channel // contains filtered or unexported fields }
func (*TcpSession) HeartBeat ¶
func (this *TcpSession) HeartBeat()
func (*TcpSession) IsActive ¶
func (this *TcpSession) IsActive() bool
func (*TcpSession) OnReceiveHeartBeat ¶
func (this *TcpSession) OnReceiveHeartBeat()
func (*TcpSession) SendHeartBeatMsg ¶
func (this *TcpSession) SendHeartBeatMsg()
func (*TcpSession) SendMsg ¶
func (this *TcpSession) SendMsg(data []byte)
func (*TcpSession) Start ¶
func (this *TcpSession) Start()
func (*TcpSession) Stop ¶
func (this *TcpSession) Stop()
Click to show internal directories.
Click to hide internal directories.