yxlib

package module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: MIT Imports: 3 Imported by: 0

README

yxlib

This is a basic server library written in go language, which helps to quickly build the go server

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}
var CurServ *Server = nil

func NewServer

func NewServer(endType uint8, endNo uint16) *Server

func (*Server) AddService

func (s *Server) AddService(mod uint16, serv Service) error

func (*Server) CloseConn

func (s *Server) CloseConn(c net.Conn)

func (*Server) Connect

func (s *Server) Connect(network string, address string, timeoutSec int64) (net.Conn, error)

func (*Server) HandlePack

func (s *Server) HandlePack(p *sock.SockPack, c net.Conn, mod uint16) error

func (*Server) Send

func (s *Server) Send(p *sock.SockPack, c net.Conn)

func (*Server) SetHeaderProcessor

func (s *Server) SetHeaderProcessor(headerProcessor sock.SockHeaderProcessor, c net.Conn)

func (*Server) SetSockListener

func (s *Server) SetSockListener(l sock.SockListener)

func (*Server) Start

func (s *Server) Start(network string, address string) error

func (*Server) Stop

func (s *Server) Stop()

type Service

type Service interface {
	OnHandlePack(p *sock.SockPack, c net.Conn) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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