You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
redcon.serve() only returns if (*Server).done is ever set to true, which is only possible if (*Server).Close() is called.
Given that the use of redcon.Serve(ln net.Listener, ...) unlike any of the other methods exposed in the package assumes that the user is not keeping around a *redcon.Server instance, it wouldn't be possible for the user to force redcon.Serve() to ever return, which is behavior that is desired for e.g. graceful shutdown.
Rather than ignoring errors from net.Listener.Accept() in redcon.serve() unless (*Server).done is set to true, what about breaking early from redcon.serve()'s accept loop if an error is returned by net.Listener.Accept() which indicates that the listener is closed?
redcon.serve()
only returns if(*Server).done
is ever set to true, which is only possible if(*Server).Close()
is called.Given that the use of
redcon.Serve(ln net.Listener, ...)
unlike any of the other methods exposed in the package assumes that the user is not keeping around a*redcon.Server
instance, it wouldn't be possible for the user to forceredcon.Serve()
to ever return, which is behavior that is desired for e.g. graceful shutdown.Rather than ignoring errors from
net.Listener.Accept()
inredcon.serve()
unless(*Server).done
is set to true, what about breaking early fromredcon.serve()
's accept loop if an error is returned bynet.Listener.Accept()
which indicates that the listener is closed?For example:
The text was updated successfully, but these errors were encountered: