-
Notifications
You must be signed in to change notification settings - Fork 75
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
Maximum number of clients reached #40
Comments
Why do you want to have 200 simultaneous X connections? What problem are
you trying to solve?
The error returned appears to be coming from X itself?
…On Sep 9, 2017 8:59 PM, "Brad Kennedy" ***@***.***> wrote:
If you open over 200 connections and close them you will get this error:
x protocol authentication refused: Maximum number of clients reached
func TestXGB (t *testing.T) {
for i := 0; i < 1000; i++ {
t.Log("log", i, '/', 1000)
c, err := xgb.NewConn()
if err != nil {
t.Fatal("Bad things happened", err)
}
defer c.Close()
}
}
This seems to be valid application so I'm not sure what is going wrong
here.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#40>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAb34uy3rxQCC84Ug-xaAFVoci152NOuks5sgzSFgaJpZM4PSKtg>
.
|
To be more clear, we are closing the connection each time, only one should be active.
Rewrote and tested without defer to be more clear. Closing the connection should free resources correct? So creating and closing the connection 200+ times shouldn't have a resource leak. I'm trying to help assist in fixing a bug in someone else's project utilizing this codebase. See: I wrote a workaround for their library but I would like to assist in fixing it here as well. To be clear, creating 250 connections in less than a second isn't my use case, but shows the issue. Also I misunderstood how defer worked so there might have been an error in the original test case, however it shows the same result before and after, furthering my point. |
Right, the original test case did indeed open many connections simultaneously since defer applies to the scope of the enclosing function. Your second test case it's more interesting and I agree it should work. I still think it's a little odd to be opening and closing connections instead of keeping one open, but you'll have to dig into this to figure out the problem. IIRC, someone had reported this issue before, so you might have luck looking at past issues. |
If you open over 200 connections and close them you will get this error:
x protocol authentication refused: Maximum number of clients reached
This seems to be valid application so I'm not sure what is going wrong here.
The text was updated successfully, but these errors were encountered: