remove some duplication

This commit is contained in:
Naitik Shah 2013-03-25 14:39:26 -07:00
parent d0382a39e6
commit 8b2bf35743

View File

@ -35,10 +35,18 @@ const (
dec = false dec = false
) )
// A FileListener is a file backed net.Listener.
type FileListener interface {
net.Listener
// Will return the underlying file representing this Listener.
File() (f *os.File, err error)
}
// A Listener providing a graceful Close process and can be sent // A Listener providing a graceful Close process and can be sent
// across processes using the underlying File descriptor. // across processes using the underlying File descriptor.
type Listener interface { type Listener interface {
net.Listener FileListener
// Will indicate that a Close is requested preventing further Accept. It will // Will indicate that a Close is requested preventing further Accept. It will
// also wait for the active connections to be terminated before returning. // also wait for the active connections to be terminated before returning.
@ -46,17 +54,6 @@ type Listener interface {
// public API for cases where the socket must not be closed (such as systemd // public API for cases where the socket must not be closed (such as systemd
// activation). // activation).
CloseRequest() CloseRequest()
// Will return the underlying file representing this Listener.
File() (f *os.File, err error)
}
// A FileListener is a file backed net.Listener.
type FileListener interface {
net.Listener
// Will return the underlying file representing this Listener.
File() (f *os.File, err error)
} }
// A goroutine based counter that provides graceful Close for listeners. // A goroutine based counter that provides graceful Close for listeners.