cnet

package
v0.0.0-...-3edccc7 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Serve()
	Close() error
	IsClosed() bool
}

type ClientHandler

type ClientHandler func(conn net.Conn, srv *Server) Client

type Server

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

func NewServer

func NewServer(h ClientHandler) *Server

func (*Server) Clients

func (s *Server) Clients() []Client

func (*Server) Close

func (s *Server) Close()

func (*Server) Listen

func (s *Server) Listen(addr string, port int) error

func (*Server) Serve

func (s *Server) Serve()

type TextConn

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

func NewTextConn

func NewTextConn(conn net.Conn) *TextConn

func (*TextConn) Close

func (c *TextConn) Close() error

func (*TextConn) Flush

func (c *TextConn) Flush() error

func (*TextConn) ReadLine

func (c *TextConn) ReadLine() (string, error)

func (*TextConn) WriteLine

func (c *TextConn) WriteLine(line string) (int, error)

Jump to

Keyboard shortcuts

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