socketry / async-redis

MIT License
83 stars 18 forks source link

Unix socket endpoint support #31

Closed orlando-labs closed 3 years ago

orlando-labs commented 3 years ago

Hi. I found out unix socket endpoint (Async::IO::Endpoint.unix) is being treated as tcp

               |   Errno::ENOTSUP: Operation not supported - setsockopt(2)
               |   → /usr/share/ruby/forwardable.rb:235 in `setsockopt'
               |     /usr/share/ruby/forwardable.rb:235 in `setsockopt'
               |     /home/slowpilot/.bundle/ruby/2.7.0/gems/async-redis-0.5.2/lib/async/redis/client.rb:134 in `block in connect'

It tries to set IPPROTO_TCP on unix socket and fails

peer.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
ioquatix commented 3 years ago

Ah, okay, there should be a generic way to set this.

ioquatix commented 3 years ago

It should be fixed.