server

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadFromConnection

func ReadFromConnection(conn net.Conn, timeout time.Duration) (string, error)

func WriteToConnection

func WriteToConnection(conn net.Conn, timeout time.Duration, s string) error

Types

type ConnType

type ConnType string
var (
	UDP ConnType = "udp"
	TCP ConnType = "tcp"
)

type HandlerFunc

type HandlerFunc = func(conn net.Conn) error

type Server

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

func New

func New(connType ConnType, host, port string, maxCntConnect int) (*Server, error)

func (*Server) Addr

func (s *Server) Addr() string

func (*Server) Listen

func (s *Server) Listen() (err error)

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(handler HandlerFunc, chErr chan<- error) error

func (*Server) Start

func (s *Server) Start(chErr chan<- error)

Jump to

Keyboard shortcuts

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