Documentation ¶
Overview ¶
Package server provides a basic control server interface.
Note that no objects are registered by default. Users must provide their own implementations of the control interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateSocket ¶
CreateSocket creates a socket that can be used with control server, but doesn't start control server. 'addr' must be a valid and unique abstract socket name. Returns socket's FD, -1 in case of error.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a basic control server.
func Create ¶
Create creates a new control server with an abstract unix socket with the given address, which must must be unique and a valid abstract socket name.
func CreateFromFD ¶
CreateFromFD creates a new control bound to the given 'fd'. It has no registered interfaces and will not start serving until StartServing is called.
func (*Server) Register ¶
func (s *Server) Register(obj interface{})
Register registers a specific control interface with the server.
func (*Server) StartServing ¶
StartServing starts listening for connect and spawns the main service goroutine for handling incoming control requests. StartServing does not block; to wait for the control server to exit, call Wait.