forked from mirror/redcon
Added AcceptError function
This commit is contained in:
parent
a56a5c7c95
commit
fc7a9e8758
|
@ -327,6 +327,9 @@ func serve(s *Server) error {
|
||||||
if done {
|
if done {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
if s.AcceptError != nil {
|
||||||
|
s.AcceptError(err)
|
||||||
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
c := &conn{
|
c := &conn{
|
||||||
|
@ -532,6 +535,9 @@ type Server struct {
|
||||||
conns map[*conn]bool
|
conns map[*conn]bool
|
||||||
ln net.Listener
|
ln net.Listener
|
||||||
done bool
|
done bool
|
||||||
|
|
||||||
|
// AcceptError is an optional function used to handle Accept errors.
|
||||||
|
AcceptError func(err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TLSServer defines a server for clients for managing client connections.
|
// TLSServer defines a server for clients for managing client connections.
|
||||||
|
|
Loading…
Reference in New Issue