bmux

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2025 License: MIT Imports: 13 Imported by: 0

README

bmux

Package bmux provides a fast, modular router for handling framed binary messages in custom protocols, game servers, or other high-performance network applications.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Server)

Option allows configuring the Server during creation.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server manages TCP connections and dispatches parsed messages to appropriate route handlers defined via the Router interface.

func New

func New(headerPrototype any, opts ...Option) *Server

New returns a new Server instance with a required header prototype and optional settings.

func (*Server) LoadMiddleware

func (s *Server) LoadMiddleware(mws []middleware.Middleware)

LoadMiddleware appends global middleware to be applied to all routes.

func (*Server) LoadRouter

func (s *Server) LoadRouter(routers []router.Router)

LoadRouter appends routers to the server's list, deferring route registration.

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown initiates a graceful shutdown, closing the listener and waiting for all active connections.

func (*Server) Start

func (s *Server) Start() error

Start begins accepting connections on the configured TCP address and port.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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