server

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2020 License: Unlicense Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OnReadCallbackFunc

type OnReadCallbackFunc func(net.Conn, []byte, *log.Logger)

OnReadCallbackFunc is a function to be called when a line is read from Conn

type Server

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

Server represents a server

func New

func New(network, addr string, logger *log.Logger) *Server

New creates a new server

func (*Server) HandleConn

func (s *Server) HandleConn(conn net.Conn, callback OnReadCallbackFunc)

HandleConn handles a net.Conn

func (*Server) Start

func (s *Server) Start(callback OnReadCallbackFunc) error

Start starts a server and spawns a goroutine when a new connection is accepted

Jump to

Keyboard shortcuts

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