Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient(opts ...ClientOption) network.Client
func NewServer ¶
func NewServer(opts ...ServerOption) network.Server
Types ¶
type ClientOption ¶
type ClientOption func(o *clientOptions)
func WithClientDialAddr ¶
func WithClientDialAddr(addr string) ClientOption
WithClientDialAddr 设置拨号地址
func WithClientHeartbeatInterval ¶
func WithClientHeartbeatInterval(heartbeatInterval time.Duration) ClientOption
WithClientHeartbeatInterval 设置心跳间隔时间
type ServerOption ¶
type ServerOption func(o *serverOptions)
func WithServerHeartbeatInterval ¶
func WithServerHeartbeatInterval(heartbeatInterval time.Duration) ServerOption
WithServerHeartbeatInterval 设置心跳检测间隔时间
func WithServerListenAddr ¶
func WithServerListenAddr(addr string) ServerOption
WithServerListenAddr 设置监听地址
func WithServerMaxConnNum ¶
func WithServerMaxConnNum(maxConnNum int) ServerOption
WithServerMaxConnNum 设置连接的最大连接数
Click to show internal directories.
Click to hide internal directories.