gonet

package
v0.0.0-...-52d6a69 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

README

gonet

一个通用高效的游戏网络库

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteBuffer

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

func NewByteBuffer

func NewByteBuffer() *ByteBuffer

func (*ByteBuffer) Append

func (this *ByteBuffer) Append(buff ...byte)

func (*ByteBuffer) MaxSize

func (this *ByteBuffer) MaxSize() int

func (*ByteBuffer) Prepend

func (this *ByteBuffer) Prepend(buff []byte) bool

func (*ByteBuffer) RdBuf

func (this *ByteBuffer) RdBuf() []byte

func (*ByteBuffer) RdFlip

func (this *ByteBuffer) RdFlip(size int)

func (*ByteBuffer) RdReady

func (this *ByteBuffer) RdReady() bool

func (*ByteBuffer) RdSize

func (this *ByteBuffer) RdSize() int

func (*ByteBuffer) Reset

func (this *ByteBuffer) Reset()

func (*ByteBuffer) WrBuf

func (this *ByteBuffer) WrBuf() []byte

func (*ByteBuffer) WrFlip

func (this *ByteBuffer) WrFlip(size int)

func (*ByteBuffer) WrGrow

func (this *ByteBuffer) WrGrow(size int)

func (*ByteBuffer) WrSize

func (this *ByteBuffer) WrSize() int

type IService

type IService interface {
	Init() bool
	Reload()
	MainLoop()
	Final() bool
}

type ITcpTask

type ITcpTask interface {
	ParseMsg(data []byte, flag byte) bool
	OnClose()
}

type Service

type Service struct {
	Derived IService
	// contains filtered or unexported fields
}

func (*Service) Main

func (this *Service) Main() bool

func (*Service) Terminate

func (this *Service) Terminate()

type TcpClient

type TcpClient struct {
}

func (*TcpClient) Connect

func (this *TcpClient) Connect(address string) (*net.TCPConn, error)

type TcpServer

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

func (*TcpServer) Accept

func (this *TcpServer) Accept() (*net.TCPConn, error)

func (*TcpServer) Bind

func (this *TcpServer) Bind(address string) error

func (*TcpServer) BindAccept

func (this *TcpServer) BindAccept(address string, handler func(*net.TCPConn)) error

func (*TcpServer) Close

func (this *TcpServer) Close() error

type TcpTask

type TcpTask struct {
	Conn    net.Conn
	Derived ITcpTask
	// contains filtered or unexported fields
}

func NewTcpTask

func NewTcpTask(conn net.Conn) *TcpTask

func (*TcpTask) AsyncSend

func (this *TcpTask) AsyncSend(buffer []byte, flag byte) bool

func (*TcpTask) Close

func (this *TcpTask) Close()

func (*TcpTask) IsClosed

func (this *TcpTask) IsClosed() bool

func (*TcpTask) IsVerified

func (this *TcpTask) IsVerified() bool

func (*TcpTask) RemoteAddr

func (this *TcpTask) RemoteAddr() string

func (*TcpTask) Start

func (this *TcpTask) Start()

func (*TcpTask) Verify

func (this *TcpTask) Verify()

Jump to

Keyboard shortcuts

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