hello

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

README

Run Hello Demo

1. prepare


git clone https://gitee.com/manangui/dubbogo-getty-xjie.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_queue_length=128 \
    -task_queue_number=16 \
    -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_queue_length=100 \
    -task_queue_number=4 \
    -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

Jump to

Keyboard shortcuts

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