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

Add path to UNIXSocket created by UNIXServer #5869

Merged
merged 1 commit into from Apr 13, 2018

Conversation

straight-shoota
Copy link
Member

A UNIXServer creates an instance of UNIXSocket for every incoming socket connection but unlike client sockets, the values for local_address and remote_address were missing. This PR adds them.

UNIXServer.open(path) do |server|
  server.local_address.path     # => path

  UNIXSocket.open(path) do |client|
    client.local_address.path   # => path
    client.remote_address.path  # => path

    server.accept do |sock|
      sock.local_address.path   # => path (previously "")
      sock.remote_address.path  # => path (previously "")
    end
  end
end

There were specs to explicitly check that local_address and remote_address on a server UNIXSocket would be "" but I don't think there is any reason for this and they should in fact return the path the server listens to.

@RX14 RX14 added this to the Next milestone Apr 13, 2018
@RX14 RX14 merged commit 9376982 into crystal-lang:master Apr 13, 2018
@straight-shoota straight-shoota deleted the jm/fix/unix-server-path branch April 13, 2018 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants