-
Notifications
You must be signed in to change notification settings - Fork 39
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
#stop causes "Errno::ENOTCONN: Socket is not connected" in OSX #24
Comments
OK, the hunt is on. Unfortunately, I don't have access to OSX, and I don't get that error in Debian. I'll do some thinking and googling and see what springs to mind. |
@jcarlson Here's how webrick, in Ruby's standard library, shuts down a server socket:
Based on that, I have an idea or two to try. I don't know if OSX makes it easy or hard to make local modifications to an installed gem, but if it isn't too hard, could you please try changing Server#stop, in file ftpd/lib/ftpd/server.rb, from this:
to this:
and see what happens? If it would be easier for you if I made a branch on github and put this (and other, future attempts) in that branch, then I'll do that. Bundler makes it pretty easy to pull a gem from a github branch. Just let me know. |
If you can put it on a branch, I can test it on both my mac and push it to our CI server and test it there. I'll try to get to it today. If you don't have time to make a branch, I can clone the repo if necessary when I get to this today. |
Branch made. Here's the Gemfile line:
|
Okay, this worked on my OS X machine locally. I'm sending it to our CI server to test there and will report back shortly. |
This also works on our CI server (Unix), so I think you nailed it. |
Many thanks again for so quickly resolving this issue! |
@jcarlson You are welcome! Thank you for working so well with me on it. This one was kinda fun. The gem has been updated--if you get version 0.15.0, it'll have the fix. |
@jcarlson reports that the bug fix for #23 causes "Errno::ENOTCONN: Socket is not connected" in OSX when #stop is called on the server:
Unfortunately, this doesn't fix my problem. Now, on OS X, when I call server.stop, it raises an error immediately:
This is better because it fails fast, but obviously still an issue.
I'm on Ruby 2.0.0p353 on OS X 10.8.5. Our CI server is on Ubuntu.
FWIW, the reason I don't use a random port number is that my client code reads settings from a YAML file in the config directory. So when I setup my test server, I also read from that YAML file and have the server start on the port that the YAML file specifies. I guess I could hack around until I can make the port a sort of shared read/write global that the server can update when the port is known... but I don't particularly love that path.
Here's a couple test helper methods that seem to get the trick done with v0.11.0:
The text was updated successfully, but these errors were encountered: