Skip to content
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

Non-blocking Socket Connect #164

Closed
wants to merge 5 commits into from
Closed

Non-blocking Socket Connect #164

wants to merge 5 commits into from

Conversation

mtodd
Copy link
Member

@mtodd mtodd commented Nov 30, 2014

This replaces the existing, blocking connection implementation with non-blocking connection logic.

More (tests) to come.

cc @jch @schaary

@mtodd
Copy link
Member Author

mtodd commented Dec 1, 2014

Test failure due to issue documented in #166.

@jch
Copy link
Member

jch commented Dec 15, 2014

I saw #167 first, but similar sentiment as my comment in #167 (comment)

@mtodd
Copy link
Member Author

mtodd commented Dec 22, 2014

Merging #180 will likely cause conflicts for this PR.

Update: Nope, #180 only changed Net::LDAP connection handling, this deals with Net::LDAP::Connection.

@mtodd
Copy link
Member Author

mtodd commented Dec 24, 2014

@jch @schaary does this change work on its own or should this introduce the changes as an option to Net::LDAP::Connection.new?

Net::LDAP.new :connect_nonblock => true? Would be part of an "unstable" API, or deprecated-from-the-start so that we could remove it at any time when we make it the default (if that happens).

@jch
Copy link
Member

jch commented Dec 29, 2014

@mtodd I'd rather have this change not be an option so we can surface edge cases sooner. But I see you point about having an unstable API as well. I'll defer to what you feel is best.

@mtodd
Copy link
Member Author

mtodd commented Dec 29, 2014

@jch well, we are working before a 1.0 so perhaps instability is warranted here.

We've not been in the habit of performing pre-releases but in this case it might be worth the effort, assuming we can get integrators to test the prerelease in their environments.

@jch
Copy link
Member

jch commented Dec 31, 2014

👍

rescue Exception => e
# unexpected error
socket.close
raise Net::LDAP::LdapError, "Connection to #{host}:#{port} (#{ip}) failed: (#{e.class}) #{e.message}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think new exception class inheriting Net::LDAP::Error should be defined for this error.

@HarlemSquirrel
Copy link
Member

If I'm not mistaken, #273 added non-blocking connections when timeout is set so I think we no longer need this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants