hello

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

README

Run Hello Demo

1. prepare


git clone https://github.com/apache/dubbo-getty.git

cd getty/demo/hello

2. run server

run server: go run tcp/server/server.go

Or run server in task pool mode:

go run tcp/server/server.go -taskPool=true \
    -task_pool_size=2000 \
    -pprof_port=60000

3. run client

go run tcp/client/client.go

Or run client in task pool mode:

go run tcp/client/client.go -taskPool=true \
    -task_pool_size=50 \
    -pprof_port=60001

Documentation

Index

Constants

View Source
const (
	CronPeriod      = 20e9
	WritePkgTimeout = 1e8
)

Variables

View Source
var Sessions []getty.Session

Functions

func ClientRequest

func ClientRequest()

Types

type MessageHandler

type MessageHandler struct {
	SessionOnOpen func(session getty.Session)
}

func (*MessageHandler) OnClose

func (h *MessageHandler) OnClose(session getty.Session)

func (*MessageHandler) OnCron

func (h *MessageHandler) OnCron(session getty.Session)

func (*MessageHandler) OnError

func (h *MessageHandler) OnError(session getty.Session, err error)

func (*MessageHandler) OnMessage

func (h *MessageHandler) OnMessage(session getty.Session, pkg interface{})

func (*MessageHandler) OnOpen

func (h *MessageHandler) OnOpen(session getty.Session) error

type PackageHandler

type PackageHandler struct{}

func (*PackageHandler) Read

func (h *PackageHandler) Read(ss getty.Session, data []byte) (interface{}, int, error)

func (*PackageHandler) Write

func (h *PackageHandler) Write(ss getty.Session, p interface{}) ([]byte, error)

Directories

Path Synopsis
tcp
tls

Jump to

Keyboard shortcuts

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