lib/async/io/address_endpoint.rb in async-io-1.14.0 vs lib/async/io/address_endpoint.rb in async-io-1.15.0

- old
+ new

@@ -36,13 +36,18 @@ end attr :address attr :options + # Bind a socket to the given address. If a block is given, the socket will be automatically closed when the block exits. + # @yield [Socket] the bound socket + # @return [Socket] the bound socket def bind(&block) Socket.bind(@address, **@options, &block) end + # Connects a socket to the given address. If a block is given, the socket will be automatically closed when the block exits. + # @return [Socket] the connected socket def connect(&block) Socket.connect(@address, **@options, &block) end end