muti_service

package
v0.0.0-...-baa1c12 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//ErrServerNumNotExist don's exist that server num.
	ErrServerNumNotExist = "ErrServerNumNotExist :[%d]"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FConn

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

func (*FConn) Close

func (this *FConn) Close() error

func (*FConn) Desc

func (this *FConn) Desc() string

func (*FConn) ErrClose

func (this *FConn) ErrClose(err error)

func (*FConn) LocalAddr

func (this *FConn) LocalAddr() net.Addr

func (*FConn) Read

func (this *FConn) Read(b []byte) (n int, err error)

func (*FConn) RecvFromSM

func (this *FConn) RecvFromSM(msg []byte)

func (*FConn) RemoteAddr

func (this *FConn) RemoteAddr() net.Addr

func (*FConn) SendToSM

func (this *FConn) SendToSM(msg []byte)

func (*FConn) SetDeadline

func (this *FConn) SetDeadline(t time.Time) error

func (*FConn) SetReadDeadline

func (this *FConn) SetReadDeadline(t time.Time) error

func (*FConn) SetTimeOut

func (this *FConn) SetTimeOut(t time.Duration)

func (*FConn) SetWriteDeadline

func (this *FConn) SetWriteDeadline(t time.Time) error

func (*FConn) Write

func (this *FConn) Write(b []byte) (n int, err error)

type FConnFactory

type FConnFactory func(no int64, mgr *ServiceManager, desc string, localAddr, remoteAddr net.Addr) ForwardConnItf

FConnFactory .

type ForwardConnItf

type ForwardConnItf interface {
	net.Conn
	SendToSM(msg []byte)
	RecvFromSM(msg []byte)
	Desc() string
	SetTimeOut(t time.Duration)
	ErrClose(err error)
}

type ServiceManager

type ServiceManager struct {
	OnErr   smn_err.OnErr
	TimeOut time.Duration

	FConnFactory FConnFactory
	// contains filtered or unexported fields
}

ServiceManager .

func NewServiceManager

func NewServiceManager(conn net.Conn) *ServiceManager

func (*ServiceManager) Close

func (this *ServiceManager) Close()

func (*ServiceManager) Drop

func (this *ServiceManager) Drop(no int64)

func (*ServiceManager) GetFConn

func (this *ServiceManager) GetFConn(no int64) (ForwardConnItf, bool)

func (*ServiceManager) Regitster

func (this *ServiceManager) Regitster(no int64, desc string) (conn ForwardConnItf, isExist bool)

func (*ServiceManager) Send

func (this *ServiceManager) Send(p *smn_base.FPkg)

func (*ServiceManager) Work

func (this *ServiceManager) Work()

Jump to

Keyboard shortcuts

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