server

package
v0.0.0-...-9debb76 Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package server implements the main network logic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addr          string
	MaxPacketSize int
	Timeout       int
	LogLevel      string
}

Config is used to configure a Server.

type Server

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

func NewServer

func NewServer(cfg Config, g *game.Game) (*Server, error)

func (*Server) Addr

func (s *Server) Addr() net.Addr

Addr returns the address that the server is listening on.

func (*Server) Close

func (s *Server) Close() error

Close stops the server.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

ListenAndServe will run the Server

Jump to

Keyboard shortcuts

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