tcp_server

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnTcpSvr

type ConnTcpSvr struct {
	tcp_server.TcpPacketSvr
	// contains filtered or unexported fields
}

必须实现 tcpserver.ITcpPacketSvrEventHandler

func NewTcpSvr

func NewTcpSvr() *ConnTcpSvr

func (*ConnTcpSvr) BroadcastByZone

func (t *ConnTcpSvr) BroadcastByZone(zone int32, data1 []byte, data2 []byte)

func (*ConnTcpSvr) InitAndRun

func (t *ConnTcpSvr) InitAndRun(ip string, port int) error

func (*ConnTcpSvr) Kick

func (t *ConnTcpSvr) Kick(uid uint64, reason g1_protocol.EKickOutReason)

func (*ConnTcpSvr) KickByRemoteAddr

func (t *ConnTcpSvr) KickByRemoteAddr(uid uint64, reason g1_protocol.EKickOutReason, remoteAddr string)

func (*ConnTcpSvr) OnClose

func (t *ConnTcpSvr) OnClose(conn net.Conn)

被Read协程调用,每个Connection对应一个Read协调

func (*ConnTcpSvr) OnConn

func (t *ConnTcpSvr) OnConn(conn net.Conn)

被Listener协程调用,一个TcpSvr对应一个Listener协程

func (*ConnTcpSvr) OnPacket

func (t *ConnTcpSvr) OnPacket(conn net.Conn, data []byte)

被Read协程调用,每个Connection对应一个Read协调

func (*ConnTcpSvr) SendByUid

func (t *ConnTcpSvr) SendByUid(uid uint64, data1 []byte, data2 []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL