tcp

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 20 Imported by: 0

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 WithClientEnableHeartbeat

func WithClientEnableHeartbeat(enable bool) ClientOption

WithClientEnableHeartbeat 设置是否启用心跳间隔时间

func WithClientHeartbeatInterval

func WithClientHeartbeatInterval(heartbeatInterval time.Duration) ClientOption

WithClientHeartbeatInterval 设置心跳间隔时间

func WithClientMaxMsgLen

func WithClientMaxMsgLen(maxMsgLen int) ClientOption

WithClientMaxMsgLen 设置消息最大长度

type ServerOption

type ServerOption func(o *serverOptions)

func WithServerEnableHeartbeatCheck

func WithServerEnableHeartbeatCheck(enable bool) ServerOption

WithServerEnableHeartbeatCheck 是否启用心跳检测

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 设置连接的最大连接数

func WithServerMaxMsgLen

func WithServerMaxMsgLen(maxMsgLen int) ServerOption

WithServerMaxMsgLen 设置消息最大长度

Jump to

Keyboard shortcuts

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