Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener implements a net.Listener interface but multiplexes connections from multiple listeners.
func New ¶
New creates an instance of a Listener using the given listeners. You must pass at least one listener. The new listener object listens for new connection on all the given listeners.
func (*Listener) Accept ¶
Accept will wait for a result from calling Accept from the underlying listeners. It will return an error if the multi-listener is closed.
func (*Listener) Addr ¶
Addr returns the address of the first listener the multi-listener is using. The address of other listeners are not available.
func (*Listener) Close ¶
Close will close the multi-listener by iterating over its listeners and calling Close() on each one. If an error is encountered, it is returned. If multiple errors are encountered they are returned in a MutiError. Close will also shut down the background goroutines that are calling Accept() on the underlying listeners.
Calling Close() more than once will cause it to panic.
type MultiError ¶
type MultiError struct {
Errors []error
}
MultiError is a wrapper around a slice of errors that implements the error interface.
func (*MultiError) Error ¶
func (m *MultiError) Error() string
Error concats the Error() messages of the underlying errors