Documentation ¶
Overview ¶
etsnunix implements an interface similar to etsn, but for listening for connections on a unix socket provided by the etsnsrv command.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server encapsulates the state of an etsnsrv listener.
func New ¶
New creates a new server that advertises its protocols at dir.
logger is called whenever there's an error establishing a connection within Listen. Note that the error may be nil. If logger is nil, a no op logger is used.
func (*Server) Listen ¶
Listen advertises a single protocol, proto, in the directory the server was created with. It will invoke handler in a new goroutine every time a fd representing a tcp socket is sent down the unix domain socket created at dir/proto by an instance of etnsrv on dir.
Warning: if there is an existing file named dir/proto it will be deleted.
It is safe to call multiple times on same server, with different proto.
Notes ¶
Bugs ¶
There are surely many an error that should lead to us breaking out of the listen loop. For example if another process deletes our socket