nio_server

package
v0.2.40 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: BSD-3-Clause Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NioClientsStore

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

func NewNioClientsStore

func NewNioClientsStore(publicKey func() *rsa.PublicKey) (instance *NioClientsStore)

func (*NioClientsStore) Count

func (instance *NioClientsStore) Count() int

func (*NioClientsStore) Descriptors

func (instance *NioClientsStore) Descriptors() []*NioConnectionDescriptor

func (*NioClientsStore) Get

func (instance *NioClientsStore) Get(connId string) (response *NioConnection)

func (*NioClientsStore) Ids

func (instance *NioClientsStore) Ids() []string

func (*NioClientsStore) Pop

func (instance *NioClientsStore) Pop(connId string) (response *NioConnection)

func (*NioClientsStore) Push

func (instance *NioClientsStore) Push(conn net.Conn) (response *NioConnection)

type NioConnection

type NioConnection struct {
	Descriptor *NioConnectionDescriptor
	// contains filtered or unexported fields
}

func WrapConnection

func WrapConnection(conn net.Conn, serverKey *rsa.PublicKey) (instance *NioConnection)

func (*NioConnection) Close

func (instance *NioConnection) Close()

func (*NioConnection) Conn

func (instance *NioConnection) Conn() (conn net.Conn)

func (*NioConnection) GetAddr

func (instance *NioConnection) GetAddr() (response string)

func (*NioConnection) GetId

func (instance *NioConnection) GetId() (response string)

func (*NioConnection) GetPublicKey

func (instance *NioConnection) GetPublicKey() (response *rsa.PublicKey)

func (*NioConnection) ParseDescriptor

func (instance *NioConnection) ParseDescriptor(descriptor string)

func (*NioConnection) ReadMessage

func (instance *NioConnection) ReadMessage() (response *nio_commons.NioMessage, err error)

func (*NioConnection) String

func (instance *NioConnection) String() string

func (*NioConnection) WriteHandshake

func (instance *NioConnection) WriteHandshake(body interface{}) (err error)

func (*NioConnection) WriteMessage

func (instance *NioConnection) WriteMessage(body interface{}, isHandshake bool) error

type NioConnectionDescriptor

type NioConnectionDescriptor struct {
	Id          string `json:"id"`
	Addr        string `json:"addr"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

func (*NioConnectionDescriptor) String

func (instance *NioConnectionDescriptor) String() string

type NioMessageHandler

type NioMessageHandler func(message *nio_commons.NioMessage) interface{}

type NioServer

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

func NewNioServer

func NewNioServer(port int) *NioServer

func (*NioServer) ClientDescriptors

func (instance *NioServer) ClientDescriptors() []*NioConnectionDescriptor

func (*NioServer) ClientsCount

func (instance *NioServer) ClientsCount() int

func (*NioServer) ClientsId

func (instance *NioServer) ClientsId() []string

func (*NioServer) Close

func (instance *NioServer) Close() error

func (*NioServer) GetPublicKey

func (instance *NioServer) GetPublicKey() (response *rsa.PublicKey)

func (*NioServer) GetUUID

func (instance *NioServer) GetUUID() string

func (*NioServer) IsOpen

func (instance *NioServer) IsOpen() bool

func (*NioServer) Join

func (instance *NioServer) Join()

Join Wait is stopped

func (*NioServer) OnMessage

func (instance *NioServer) OnMessage(callback NioMessageHandler)

func (*NioServer) OnNewConn

func (instance *NioServer) OnNewConn(callback func(conn *NioConnection))

func (*NioServer) Open

func (instance *NioServer) Open() (err error)

func (*NioServer) Port

func (instance *NioServer) Port() int

Jump to

Keyboard shortcuts

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