limits

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: GPL-3.0 Imports: 12 Imported by: 3

Documentation

Overview

Package limits contains many options for setting Global limits on how the overall application behaves. Many of these options are configured by build tags.

Other functions include re-implemented standard library functions.

Index

Constants

View Source
const Frag = 33554432 // 33_554_432

Frag is the max size used to fragment packets into. Any packet over this byte size will be fragmented.

View Source
const Packets = 256

Packets determines how many Packets may be processed by the Session thread before waiting another wait cycle. If this is set to anything less than one, only a single Packet will be processed at a time.

Variables

This section is empty.

Functions

func Ignore added in v0.1.0

func Ignore()

Ignore is a simple helper method that can be used to ignore signals that can be used to abort or generate a stack-trace.

Used for anti-debugging measures.

func MemorySweep added in v0.0.6

func MemorySweep(x context.Context)

MemorySweep enables the GC memory sweeper, which keeps the process memory clean to prevent any crashes while in DLL format or injected. This function only needs to be called once and will return immediately.

The context is recommended to prevent any leaking Goroutines from being left behind.

Defaults to a time of one minute.

func MemorySweepEx added in v0.0.6

func MemorySweepEx(x context.Context, d time.Duration)

MemorySweepEx enables the GC memory sweeper, which keeps the process memory clean to prevent any crashes while in DLL format or injected. This function only needs to be called once and will return immediately.

The context is recommended to prevent any leaking Goroutines from being left behind.

Allows for specification of the time span between sweeps.

func Notify added in v0.2.5

func Notify(c chan<- os.Signal, s ...os.Signal)

Notify causes package signal to relay incoming signals to c. If no signals are provided, all incoming signals will be relayed to c. Otherwise, just the provided signals will.

Package signal will not block sending to c: the caller must ensure that c has sufficient buffer space to keep up with the expected signal rate. For a channel used for notification of just one signal value, a buffer of size 1 is sufficient.

It is allowed to call Notify multiple times with the same channel: each call expands the set of signals sent to that channel. The only way to remove signals from the set is to call Stop.

It is allowed to call Notify multiple times with different channels and the same signals: each channel receives copies of incoming signals independently.

This version will stop the signal handling loop once the 'StopNotify' function has been called.

If the Go version is 1.13 or less this function is just a wrapper for 'signal.Notify'.

func Reset added in v0.2.0

func Reset()

Reset will undo all the signals ignored by the 'Ignore' function.

func StopNotify added in v0.2.5

func StopNotify(c chan<- os.Signal)

StopNotify will stop the signal handling loop from running and will cause all signal handling to stop.

This function will block until the Goroutine closes.

This function has no effect if the loop is not started or stopped.

The supplied chan can be nil but if non-nil will be passed to 'signal.Stop' for convince.

If the Go version is 1.13 or less this function is just a wrapper for 'signal.Stop'.

Types

This section is empty.

Jump to

Keyboard shortcuts

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