io-endpoint 0.9.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a8c719f57ec802f2b04eed41ba8ae7b1a1d50ce90b2d4f0c7188c4b8f62f7306
4
- data.tar.gz: dd9bdffdb227f14e4de51d7da5d345ff230b8d05c1da91c41d6f928ce2844a01
3
+ metadata.gz: 38306bd23243b3a887ade16d518ed42e15d716bb71d3a8ab264e18e2d0fe0502
4
+ data.tar.gz: 50830ba30ca726fc75f02e641f21165b7790179cff22046f9ad58f26f603f34f
5
5
  SHA512:
6
- metadata.gz: b8da3c12efc9df9557fdd23d08364a34cde7d89777e078d695fbea2470e3a3a4a30b58d33e0cebaffea0680fd609cdf13a66239f390abe366ae18139eb3860c3
7
- data.tar.gz: 0cf5dc1fa569e2f010bdcfdd5351e21ccb0a92055d0af361b7dafae7d0431923556c4673fc6975989211e8cdaf7a449c1f277588d5ae68e78409ac7d5b6bbc30
6
+ metadata.gz: 2c9a1013a086f55b015ee37a9cecfa01739f2c6f4066cfd12c24b6ec345235a5e6f2510f09ad7947c234aada8ec3beb7bb0369dc516fae1a524084c7e9876f6f
7
+ data.tar.gz: 8c19203762bd36f40fffe3870a907e6b21119fea7d0293627e441ac7829bf023dfc7aee30b6eb24e2bb9ea26a1f929e20689dfb95bb31a8893bae356318bba03
checksums.yaml.gz.sig CHANGED
Binary file
@@ -5,6 +5,6 @@
5
5
 
6
6
  class IO
7
7
  module Endpoint
8
- VERSION = "0.9.0"
8
+ VERSION = "0.10.1"
9
9
  end
10
10
  end
@@ -9,15 +9,10 @@ module IO::Endpoint
9
9
  class Wrapper
10
10
  include ::Socket::Constants
11
11
 
12
- if IO.method_defined?(:timeout=)
13
- def set_timeout(io, timeout)
12
+ def set_timeout(io, timeout)
13
+ if io.respond_to?(:timeout=)
14
14
  io.timeout = timeout
15
15
  end
16
- else
17
- def set_timeout(io, timeout)
18
- # warn "IO#timeout= not supported on this platform."
19
- # Unsupported.
20
- end
21
16
  end
22
17
 
23
18
  def set_buffered(socket, buffered)
@@ -107,7 +102,7 @@ module IO::Endpoint
107
102
  # @parameter reuse_address [Boolean] Allow this port to be bound in multiple processes.
108
103
  # @parameter linger [Boolean] Wait for data to be sent before closing the socket.
109
104
  # @parameter protocol [Integer] The socket protocol to use.
110
- def bind(local_address, protocol: 0, reuse_address: true, reuse_port: nil, linger: nil, bound_timeout: nil, **options, &block)
105
+ def bind(local_address, protocol: 0, reuse_address: true, reuse_port: nil, linger: nil, bound_timeout: nil, backlog: Socket::SOMAXCONN, **options, &block)
111
106
  socket = nil
112
107
 
113
108
  begin
@@ -131,6 +126,10 @@ module IO::Endpoint
131
126
  end
132
127
 
133
128
  socket.bind(local_address.to_sockaddr)
129
+
130
+ if backlog
131
+ socket.listen(backlog)
132
+ end
134
133
  rescue
135
134
  socket&.close
136
135
  raise
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: io-endpoint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file