github.com/cmd-stream/base-go@v0.0.0-20230813145615-dd6ac24c16f5/listener.go (about) 1 package base 2 3 import ( 4 "net" 5 "time" 6 ) 7 8 // Listener represents a network listener for the cmd-stream server. 9 // 10 // On Close it should not close already accepted connections. 11 type Listener interface { 12 Addr() net.Addr 13 SetDeadline(time.Time) error 14 Accept() (net.Conn, error) 15 Close() error 16 }