package
0.0.0-20230903062148-258f086348c8
Repository: https://github.com/xen0tic/utils.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# Functions

NewClient creates an instance of Client.
Run starts handling events on the specified address.
Stop gracefully shuts down the engine without interrupting any active event-loops, it waits indefinitely for connections and event-loops to be closed and then shuts down.
WithLoadBalancing sets up the load-balancing algorithm in gnet engine.
WithLockOSThread sets up LockOSThread mode for I/O event-loops.
WithLogger sets up a customized logger.
WithLogLevel is an option to set up the logging level.
WithLogPath is an option to set up the local path of log file.
WithMulticastInterfaceIndex sets the interface name where UDP multicast sockets will be bound to.
WithMulticore sets up multi-cores in gnet engine.
WithNumEventLoop sets up NumEventLoop in gnet engine.
WithOptions sets up all options.
WithReadBufferCap sets up ReadBufferCap for reading bytes.
WithReuseAddr sets up SO_REUSEADDR socket option.
WithReusePort sets up SO_REUSEPORT socket option.
WithSocketRecvBuffer sets the maximum socket receive buffer in bytes.
WithSocketSendBuffer sets the maximum socket send buffer in bytes.
WithTCPKeepAlive sets up the SO_KEEPALIVE socket option with duration.
WithTCPNoDelay enable/disable the TCP_NODELAY socket option.
WithTicker indicates that a ticker is set.
WithWriteBufferCap sets up WriteBufferCap for pending bytes.

# Constants

Close closes the connection.
LeastConnections assigns the next accepted connection to the event-loop that is serving the least number of active connections at the current time.
None indicates that no action should occur following an event.
RoundRobin assigns the next accepted connection to the event-loop by polling event-loop list.
Shutdown shutdowns the engine.
SourceAddrHash assigns the next accepted connection to the event-loop by hashing the remote address.
Available TCP socket options.
Available TCP socket options.

# Variables

# Structs

No description provided by the author
Client of gnet.
Engine represents an engine context which provides some functions.
Options are configurations for the gnet application.

# Interfaces

Conn is an interface of underlying connection.
No description provided by the author
Reader is an interface that consists of a number of methods for reading that Conn must implement.
Socket is a set of functions which manipulate the underlying file descriptor of a connection.
Writer is an interface that consists of a number of methods for writing that Conn must implement.

# Type aliases

Action is an action that occurs after the completion of an event.
AsyncCallback is a callback which will be invoked after the asynchronous functions has finished executing.
LoadBalancing represents the type of load-balancing algorithm.
Option is a function that will set up option.
TCPSocketOpt is the type of TCP socket options.