-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add option for max connection #112
Conversation
@@ -274,6 +280,12 @@ func (app *App) makeServer(addr string, handler *http.Handler) (*http.Server, er | |||
} | |||
|
|||
func (app *App) handleWS(w http.ResponseWriter, r *http.Request) { | |||
if app.options.MaxConnection != 0 { | |||
if connection >= app.options.MaxConnection { | |||
log.Printf("reached max connection: %d", app.options.MaxConnection) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Log messages should start with a capital letter
Hi, thank you for the PR. I think MaxConnection makes sense and is useful. |
Thanks for your consideration of my PR. I've rearranged log and moved var |
@zyfdegh Thanks for the update.
I therefore want to merge the lines both on opening and closing connections. |
Okay, I forgot about concurrency. Logs are merged now. ;-) |
Thanks! |
add option in config file