tcp

package
v1.0.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

inspired by dubbogo/remoting/getty

inspired by dubbogo/remoting/getty

Index

Constants

View Source
const (
	// WritePkg_Timeout the timeout of write pkg
	WritePkg_Timeout = 5 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PackageHandler

type PackageHandler struct {
	// contains filtered or unexported fields
}

func NewPackageHandler

func NewPackageHandler(ls *TcpListenerService) *PackageHandler

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)

type ServerHandler

type ServerHandler struct {
	// contains filtered or unexported fields
}

ServerHandler package handler

func NewServerPackageHandler

func NewServerPackageHandler(ls *TcpListenerService) *ServerHandler

NewServerPackageHandler create serverHandler

func (*ServerHandler) OnClose

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

OnError called when session close

func (*ServerHandler) OnCron

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

OnCron cron

func (*ServerHandler) OnError

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

OnError called when err

func (*ServerHandler) OnMessage

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

OnMessage called when session receive new pkg

func (*ServerHandler) OnOpen

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

OnOpen called when session opens

type TcpListenerService

type TcpListenerService struct {
	listener.BaseListenerService
	// contains filtered or unexported fields
}

ListenerService the facade of a listener

func (*TcpListenerService) Close

func (ls *TcpListenerService) Close() error

func (*TcpListenerService) Refresh

func (ls *TcpListenerService) Refresh(c model.Listener) error

func (*TcpListenerService) ShutDown

func (ls *TcpListenerService) ShutDown(wg interface{}) error

func (*TcpListenerService) Start

func (ls *TcpListenerService) Start() error

Start start tcp server

Jump to

Keyboard shortcuts

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