server

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v1.3.1

type Client struct {
	Conn net.Conn
	Key  *[32]byte
}

type Server

type Server struct {
	IP            string
	PORT          int
	Listener      net.Listener
	UseEncoding   bool
	UseCrypto     bool
	Delimiter     []byte
	BUF_SIZE      int
	Encode_func   func([]byte) []byte
	Decode_func   func([]byte) ([]byte, error)
	CONFIG        *quickproto.Config
	Clients       map[string]*Client
	RSAPrivateKey *rsa.PrivateKey
}

func New added in v1.1.6

func New(ip string, port int, conf *quickproto.Config) *Server

func (*Server) Accept

func (s *Server) Accept() (net.Conn, *Client, error)

func (*Server) Addr

func (s *Server) Addr() string

func (*Server) Broadcast added in v1.3.1

func (s *Server) Broadcast(msg *quickproto.Message) error

func (*Server) Listen

func (s *Server) Listen() (net.Listener, error)

func (*Server) Read

func (s *Server) Read(client *Client) (*quickproto.Message, error)

func (*Server) Read_c added in v1.3.1

func (s *Server) Read_c(conn net.Conn) (*quickproto.Message, error)

func (*Server) RemoveClient added in v1.3.1

func (s *Server) RemoveClient(conn net.Conn)

func (*Server) Terminate

func (s *Server) Terminate() error

func (*Server) Write

func (s *Server) Write(client *Client, msg *quickproto.Message) error

func (*Server) Write_c added in v1.3.1

func (s *Server) Write_c(conn net.Conn, msg *quickproto.Message) error

Jump to

Keyboard shortcuts

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