Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Server ¶
type Server struct {
Add string // Address and port the server binds to.
MaxConn int // Maximum number of allowed active connections.
ActiveConn int // Current number of active connections.
sync.RWMutex
Manager *memory_allocator.SlabManager // Memory allocator for managing slab memory.
}
Server represents a server that handles TCP connections, manages active connections, and uses a memory allocator for efficient data handling.
func New ¶
func New() *Server
New initializes a new Server instance by loading the configuration and setting up the slab memory allocator.
func (*Server) HandleConn ¶
HandleConn processes an individual TCP connection, reading data, allocating slab memory, and delegating requests to a job channel.
Click to show internal directories.
Click to hide internal directories.