tcp

package
v0.3.37 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(addr string, ctx *lokas.Context) (*conn.Conn, error)

func DialEx

func DialEx(addr string, ctx *lokas.Context, retryWait time.Duration) chan struct{}

Types

type Server

type Server struct {
	Context *lokas.Context
	// contains filtered or unexported fields
}

func NewServer

func NewServer(context *lokas.Context) *Server

NewServer create a new tcp server

func (*Server) Broadcast

func (this *Server) Broadcast(sessionIds []util.ID, data []byte)

Broadcast broadcast data to all active connections

func (*Server) GetActiveConnNum

func (this *Server) GetActiveConnNum() int

GetActiveConnNum get count of active connections

func (*Server) Start

func (this *Server) Start(addr string) error

Start start tcp server

func (*Server) Stop

func (this *Server) Stop()

Stop stop tcp server

Jump to

Keyboard shortcuts

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