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

Unix socket binding - Errno::EADDRINUSE #5243

Closed
kingp0dd opened this issue May 21, 2020 · 1 comment
Closed

Unix socket binding - Errno::EADDRINUSE #5243

kingp0dd opened this issue May 21, 2020 · 1 comment

Comments

@kingp0dd
Copy link

Originally found in Puma:
puma/puma#1521

Offending code in Ruby:
https://bugs.ruby-lang.org/issues/16277

require 'socket'

path = File.expand_path('listen.sock')
backlog = 5

s = UNIXServer.new(path)
if backlog
  s.listen backlog
else
  s.listen
end

File.delete(path) if File.exists?(path)

Listening twice does not throw Errno::EADDRINUSE in Linux but it does in WSL.

@therealkenc
Copy link
Collaborator

Spiritually #2915 (TCP over there).

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

No branches or pull requests

2 participants