server

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEndWithConn

func NewEndWithConn(conn net.Conn, opts ...*EndOptions) (geminio.End, error)

Types

type EndOptions

type EndOptions struct {
	Timer             timer.Timer
	TimerOwner        interface{}
	PacketFactory     packet.PacketFactory
	Log               log.Logger
	Delegate          delegate.ServerDelegate
	ClientID          *uint64
	RemoteMethods     []string
	RemoteMethodCheck bool
	LocalMethods      []*geminio.MethodRPC
	// If set AcceptStreamFunc, the AcceptStream should never be called
	AcceptStreamFunc func(geminio.Stream)
	ClosedStreamFunc func(geminio.Stream)
}

func MergeEndOptions

func MergeEndOptions(opts ...*EndOptions) *EndOptions

func NewEndOptions

func NewEndOptions() *EndOptions

func (*EndOptions) SetAcceptStreamFunc added in v1.1.1

func (eo *EndOptions) SetAcceptStreamFunc(fn func(geminio.Stream))

func (*EndOptions) SetClientID

func (eo *EndOptions) SetClientID(clientID uint64)

func (*EndOptions) SetClosedStreamFunc added in v1.1.1

func (eo *EndOptions) SetClosedStreamFunc(fn func(geminio.Stream))

func (*EndOptions) SetDelegate

func (eo *EndOptions) SetDelegate(delegate delegate.ServerDelegate)

func (*EndOptions) SetLog

func (eo *EndOptions) SetLog(log log.Logger)

func (*EndOptions) SetPacketFactory

func (eo *EndOptions) SetPacketFactory(packetFactory packet.PacketFactory)

func (*EndOptions) SetRegisterLocalRPCs added in v1.1.0

func (eo *EndOptions) SetRegisterLocalRPCs(methodRPCs ...*geminio.MethodRPC)

func (*EndOptions) SetRemoteRPCCheck added in v1.1.4

func (eo *EndOptions) SetRemoteRPCCheck()

func (*EndOptions) SetTimer

func (eo *EndOptions) SetTimer(timer timer.Timer)

func (*EndOptions) SetWaitRemoteRPCs

func (eo *EndOptions) SetWaitRemoteRPCs(methods ...string)

type Listener

type Listener interface {
	// Accept waits for and returns the next end to the listener.
	AcceptEnd() (geminio.End, error)

	// Accept waits for and returns the next connection to the listener.
	// the returned Conn is actually a End
	Accept() (net.Conn, error)

	// Close closes the listener.
	// Any blocked Accept operations will be unblocked and return errors.
	Close() error

	// Addr returns the listener's network address.
	Addr() net.Addr
}

func Listen

func Listen(network, address string, opts ...*EndOptions) (Listener, error)

type ServerEnd

type ServerEnd struct {
	geminio.End
	// contains filtered or unexported fields
}

func (*ServerEnd) Close

func (se *ServerEnd) Close() error

Jump to

Keyboard shortcuts

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