Documentation ¶
Overview ¶
Package network 提供了更上层的网络接口
Example Usage
id, err := network.Listen(network.TcpGNet, ":6699", agent.GetSingleAgent)
Index ¶
- Constants
- Variables
- func Connect(netType NetType, address string, newAgent core.GetAgent, ...) (core.Client, error)
- func DestroyAll()
- func GetConnNum() (num int)
- func GetInfo() map[NetType]*info
- func Listen(netType NetType, address string, newAgent core.GetAgent, ...) (core.Server, error)
- type NetType
Constants ¶
View Source
const ( // TcpSeries 从 0 开始,TCP系列不同的实现 TcpSeries NetType = iota // UdpSeries UDP 系列的不同实现 UdpSeries = TcpSeries + SeriesInterval // SeriesInterval 系列间隔 SeriesInterval NetType = 1000 TcpNet = TcpSeries + 0 TcpGNet = TcpSeries + 1 )
Variables ¶
View Source
var ( // ErrUnsupportedNetType 不支持的网络类型 ErrUnsupportedNetType = errors.New("unsupported net type") )
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.