protocolinterface

package
v0.0.0-...-d336e6e Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicNet

type BasicNet struct {
	NetServer
	Host        string
	Port        int
	TCPListener *net.TCPListener
	IfStop      bool
}

BasicNet support basic operation for net interface

type BasicNetSession

type BasicNetSession struct {
	NetSession
	Conn     *net.TCPConn // connection from remote end point
	Bufio    *bufio.ReadWriter
	Extra    *interface{}
	ID       string  // session 's unique id
	RemoteIP *string // remote end point's ip of Conn
}

BasicNetSession support basic operation for session within server and client

type NetPackage

type NetPackage interface {
}

NetPackage support protocol package expression

type NetServer

type NetServer interface {
	Start(address string) error
	StartSession(conn *net.TCPConn) error
}

NetServer support protocol server operation

type NetSession

type NetSession interface {
	ReadPackage() (interface{}, error)
	WritePackage(pack interface{}) error
	ProcessPackage(pack interface{}) error
	CloseSession() error
}

NetSession support connection info with server and client

Jump to

Keyboard shortcuts

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