tcp

package
v10.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

ctx.go

Index

Constants

View Source
const (
	DEFAULT_LOG_LEVEL             = "debug"
	DEFAULT_ROOM_CLEANUP_INTERVAL = 10 * time.Minute
	DEFAULT_ROOM_TTL              = 3 * time.Hour
)

Variables

This section is empty.

Functions

func ConnectToTCPServer

func ConnectToTCPServer(address, password, room string, timelimit ...time.Duration) (c *comm.Comm, banner string, ipaddr string, err error)

ConnectToTCPServer will initiate a new connection to the specified address, room with optional time limit

func Ignore added in v10.4.0

func Ignore(err error) error

Ignore context cancellation error

func PingServer

func PingServer(address string) (err error)

func Run

func Run(debugLevel, host, port, password string, banner ...string) (err error)

Run starts a tcp listener, run async

func RunCtx added in v10.4.0

func RunCtx(ctx context.Context, debugLevel, host, port, password string, banner ...string) error

func RunWithOptionsAsync added in v10.0.11

func RunWithOptionsAsync(host, port, password string, opts ...serverOptsFunc) error

RunWithOptionsAsync asynchronously starts a TCP listener.

func WithBanner added in v10.0.11

func WithBanner(banner ...string) serverOptsFunc

func WithCtx added in v10.4.0

func WithCtx(ctx context.Context) serverOptsFunc

func WithLogLevel added in v10.0.11

func WithLogLevel(level string) serverOptsFunc

func WithRoomCleanupInterval added in v10.0.11

func WithRoomCleanupInterval(interval time.Duration) serverOptsFunc

func WithRoomTTL added in v10.0.11

func WithRoomTTL(ttl time.Duration) serverOptsFunc

Types

This section is empty.

Jump to

Keyboard shortcuts

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