Documentation
¶
Index ¶
Constants ¶
View Source
const (
DEFAULT_TIMEOUT = 5 * time.Second
)
Variables ¶
View Source
var ( ErrServerStopped = errors.New("server stopped") ErrUnknownAction = errors.New("unknown action") )
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(serverAddr config.ServerAddr, protocolManager *protocol.ProtocolManager, mode ServerMode) *Server
Required parameters will be provided from the main function
func (*Server) HandleNextConn ¶
HandleNextConn() will block until a connection is available then call handleConn() to handle the connection upon it. Or it will return an error if the context is cancelled.
type ServerMode ¶
type ServerMode uint8
const ( SERVER_MODE_WORKER ServerMode = iota // HandleNextConn() to be called by an external worker SERVER_MODE_UNLIMITED // unlimited number of connections will be handled )
Click to show internal directories.
Click to hide internal directories.