libuv 0.11.3 → 0.11.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +14 -6
  2. data/.gitignore +17 -17
  3. data/.gitmodules +3 -3
  4. data/.rspec +1 -1
  5. data/.travis.yml +16 -16
  6. data/Gemfile +4 -4
  7. data/LICENSE +23 -23
  8. data/README.md +82 -82
  9. data/Rakefile +31 -31
  10. data/lib/libuv.rb +54 -54
  11. data/lib/libuv/async.rb +47 -47
  12. data/lib/libuv/check.rb +55 -55
  13. data/lib/libuv/dns.rb +85 -85
  14. data/lib/libuv/error.rb +73 -70
  15. data/lib/libuv/ext/ext.rb +258 -258
  16. data/lib/libuv/ext/platform/darwin_x64.rb +23 -23
  17. data/lib/libuv/ext/platform/linux.rb +7 -7
  18. data/lib/libuv/ext/platform/unix.rb +29 -29
  19. data/lib/libuv/ext/platform/windows.rb +40 -40
  20. data/lib/libuv/ext/tasks.rb +29 -29
  21. data/lib/libuv/ext/tasks/mac.rb +23 -23
  22. data/lib/libuv/ext/tasks/unix.rb +23 -23
  23. data/lib/libuv/ext/tasks/win.rb +11 -11
  24. data/lib/libuv/ext/types.rb +238 -238
  25. data/lib/libuv/file.rb +191 -191
  26. data/lib/libuv/filesystem.rb +232 -232
  27. data/lib/libuv/fs_event.rb +31 -31
  28. data/lib/libuv/handle.rb +85 -85
  29. data/lib/libuv/idle.rb +56 -56
  30. data/lib/libuv/loop.rb +387 -385
  31. data/lib/libuv/mixins/assertions.rb +23 -23
  32. data/lib/libuv/mixins/fs_checks.rb +55 -55
  33. data/lib/libuv/mixins/listener.rb +34 -34
  34. data/lib/libuv/mixins/net.rb +40 -40
  35. data/lib/libuv/mixins/resource.rb +27 -27
  36. data/lib/libuv/mixins/stream.rb +154 -154
  37. data/lib/libuv/pipe.rb +197 -197
  38. data/lib/libuv/prepare.rb +56 -56
  39. data/lib/libuv/signal.rb +51 -51
  40. data/lib/libuv/tcp.rb +317 -315
  41. data/lib/libuv/timer.rb +91 -91
  42. data/lib/libuv/tty.rb +37 -37
  43. data/lib/libuv/udp.rb +224 -224
  44. data/lib/libuv/version.rb +3 -3
  45. data/lib/libuv/work.rb +75 -75
  46. data/libuv.gemspec +56 -56
  47. data/spec/async_spec.rb +60 -60
  48. data/spec/cpu_spec.rb +10 -10
  49. data/spec/defer_spec.rb +980 -980
  50. data/spec/dns_spec.rb +90 -90
  51. data/spec/filesystem_spec.rb +124 -124
  52. data/spec/idle_spec.rb +56 -56
  53. data/spec/pipe_spec.rb +160 -160
  54. data/spec/tcp_spec.rb +267 -267
  55. metadata +24 -30
@@ -1,51 +1,51 @@
1
- module Libuv
2
- class Signal < Handle
3
-
4
-
5
- SIGNALS = {
6
- :HUP => 1,
7
- :SIGHUP => 1,
8
- :INT => 2,
9
- :SIGINT => 2,
10
- :BREAK => 21,
11
- :SIGBREAK => 21,
12
- :WINCH => 28,
13
- :SIGWINCH => 28
14
- }
15
-
16
-
17
- # @param loop [::Libuv::Loop] loop this signal handler will be associated
18
- # @param callback [Proc] callback to be called when the signal is triggered
19
- def initialize(loop)
20
- @loop = loop
21
-
22
- signal_ptr = ::Libuv::Ext.create_handle(:uv_signal)
23
- error = check_result(::Libuv::Ext.signal_init(loop.handle, signal_ptr))
24
-
25
- super(signal_ptr, error)
26
- end
27
-
28
- # Enables the signal handler.
29
- def start(signal)
30
- return if @closed
31
- signal = SIGNALS[signal] if signal.is_a? Symbol
32
- error = check_result ::Libuv::Ext.signal_start(handle, callback(:on_sig), signal)
33
- reject(error) if error
34
- end
35
-
36
- # Disables the signal handler.
37
- def stop
38
- return if @closed
39
- error = check_result ::Libuv::Ext.signal_stop(handle)
40
- reject(error) if error
41
- end
42
-
43
-
44
- private
45
-
46
-
47
- def on_sig(handle, signal)
48
- defer.notify(signal) # notify of a call
49
- end
50
- end
51
- end
1
+ module Libuv
2
+ class Signal < Handle
3
+
4
+
5
+ SIGNALS = {
6
+ :HUP => 1,
7
+ :SIGHUP => 1,
8
+ :INT => 2,
9
+ :SIGINT => 2,
10
+ :BREAK => 21,
11
+ :SIGBREAK => 21,
12
+ :WINCH => 28,
13
+ :SIGWINCH => 28
14
+ }
15
+
16
+
17
+ # @param loop [::Libuv::Loop] loop this signal handler will be associated
18
+ # @param callback [Proc] callback to be called when the signal is triggered
19
+ def initialize(loop)
20
+ @loop = loop
21
+
22
+ signal_ptr = ::Libuv::Ext.create_handle(:uv_signal)
23
+ error = check_result(::Libuv::Ext.signal_init(loop.handle, signal_ptr))
24
+
25
+ super(signal_ptr, error)
26
+ end
27
+
28
+ # Enables the signal handler.
29
+ def start(signal)
30
+ return if @closed
31
+ signal = SIGNALS[signal] if signal.is_a? Symbol
32
+ error = check_result ::Libuv::Ext.signal_start(handle, callback(:on_sig), signal)
33
+ reject(error) if error
34
+ end
35
+
36
+ # Disables the signal handler.
37
+ def stop
38
+ return if @closed
39
+ error = check_result ::Libuv::Ext.signal_stop(handle)
40
+ reject(error) if error
41
+ end
42
+
43
+
44
+ private
45
+
46
+
47
+ def on_sig(handle, signal)
48
+ defer.notify(signal) # notify of a call
49
+ end
50
+ end
51
+ end
@@ -1,316 +1,318 @@
1
- require 'ipaddr'
2
- require 'ruby-tls'
3
-
4
-
5
- module Libuv
6
- class TCP < Handle
7
- include Stream, Net
8
-
9
-
10
- KEEPALIVE_ARGUMENT_ERROR = "delay must be an Integer".freeze
11
- TLS_ERROR = "TLS write failed".freeze
12
-
13
-
14
- attr_reader :connected
15
-
16
-
17
- def initialize(loop, acceptor = nil)
18
- @loop = loop
19
-
20
- tcp_ptr = ::Libuv::Ext.create_handle(:uv_tcp)
21
- error = check_result(::Libuv::Ext.tcp_init(loop.handle, tcp_ptr))
22
-
23
- if acceptor && error.nil?
24
- error = check_result(::Libuv::Ext.accept(acceptor, tcp_ptr))
25
- @connected = true
26
- else
27
- @connected = false
28
- end
29
-
30
- super(tcp_ptr, error)
31
- end
32
-
33
-
34
- #
35
- # TLS Abstraction ----------------------
36
- # --------------------------------------
37
- #
38
- def start_tls(args = {})
39
- return unless @connected && @tls.nil?
40
-
41
- @handshake = false
42
- @pending_writes = []
43
- @tls = ::RubyTls::Connection.new(self)
44
- @tls.start(args)
45
- end
46
-
47
- # Push through any pending writes when handshake has completed
48
- def handshake_cb
49
- @handshake = true
50
- writes = @pending_writes
51
- @pending_writes = nil
52
- writes.each do |deferred, data|
53
- @pending_write = deferred
54
- @tls.encrypt(data)
55
- end
56
- end
57
-
58
- # This is clear text data that has been decrypted
59
- # Same as stream.rb on_read for clear text
60
- def dispatch_cb(data)
61
- begin
62
- @progress.call data, self
63
- rescue Exception => e
64
- @loop.log :error, :stream_progress_cb, e
65
- end
66
- end
67
-
68
- # We resolve the existing tls write promise with a the
69
- # real writes promise (a close may have occurred)
70
- def transmit_cb(data)
71
- if not @pending_write.nil?
72
- @pending_write.resolve(direct_write(data))
73
- @pending_write = nil
74
- else
75
- direct_write(data)
76
- end
77
- end
78
-
79
- # Close can be called multiple times
80
- def close_cb
81
- if not @pending_write.nil?
82
- @pending_write.reject(TLS_ERROR)
83
- @pending_write = nil
84
- end
85
-
86
- # Shutdown the stream
87
- close
88
- end
89
-
90
- # overwrite the default close to ensure
91
- # pending writes are rejected
92
- def close
93
- @connected = false
94
-
95
- if not @pending_writes.nil?
96
- @pending_writes.each do |deferred, data|
97
- deferred.reject(TLS_ERROR)
98
- end
99
- @pending_writes = nil
100
- end
101
-
102
- super
103
- end
104
-
105
- # Verify peers will be called for each cert in the chain
106
- def verify_peer(&block)
107
- @tls.verify_cb &block
108
- end
109
-
110
- alias_method :direct_write, :write
111
- def write(data)
112
- if @tls.nil?
113
- direct_write(data)
114
- else
115
- deferred = @loop.defer
116
-
117
- if @handshake == true
118
- @pending_write = deferred
119
- @tls.encrypt(data)
120
- else
121
- @pending_writes << [deferred, data]
122
- end
123
-
124
- deferred.promise
125
- end
126
- end
127
- #
128
- # END TLS Abstraction ------------------
129
- # --------------------------------------
130
- #
131
-
132
- def bind(ip, port, callback = nil, &blk)
133
- return if @closed
134
- @on_listen = callback || blk
135
- assert_type(String, ip, IP_ARGUMENT_ERROR)
136
- assert_type(Integer, port, PORT_ARGUMENT_ERROR)
137
-
138
- begin
139
- @tcp_socket = create_socket(IPAddr.new(ip), port)
140
- @tcp_socket.bind
141
- rescue Exception => e
142
- reject(e)
143
- end
144
- end
145
-
146
- def open(fd, binding = true, callback = nil, &blk)
147
- return if @closed
148
- if binding
149
- @on_listen = callback || blk
150
- else
151
- @callback = callback || blk
152
- end
153
- error = check_result UV.tcp_open(handle, fd)
154
- reject(error) if error
155
- end
156
-
157
- def accept(callback = nil, &blk)
158
- begin
159
- raise RuntimeError, CLOSED_HANDLE_ERROR if @closed
160
- tcp = TCP.new(loop, handle)
161
- begin
162
- (callback || blk).call(tcp)
163
- rescue Exception => e
164
- @loop.log :error, :tcp_accept_cb, e
165
- end
166
- rescue Exception => e
167
- @loop.log :info, :tcp_accept_failed, e
168
- end
169
- nil
170
- end
171
-
172
- def connect(ip, port, callback = nil, &blk)
173
- return if @closed
174
- @callback = callback || blk
175
- assert_type(String, ip, IP_ARGUMENT_ERROR)
176
- assert_type(Integer, port, PORT_ARGUMENT_ERROR)
177
-
178
- begin
179
- @tcp_socket = create_socket(IPAddr.new(ip), port)
180
- @tcp_socket.connect(callback(:on_connect))
181
- rescue Exception => e
182
- reject(e)
183
- end
184
- end
185
-
186
- def sockname
187
- return [] if @closed
188
- sockaddr, len = get_sockaddr_and_len
189
- check_result! ::Libuv::Ext.tcp_getsockname(handle, sockaddr, len)
190
- get_ip_and_port(::Libuv::Ext::Sockaddr.new(sockaddr), len.get_int(0))
191
- end
192
-
193
- def peername
194
- return [] if @closed
195
- sockaddr, len = get_sockaddr_and_len
196
- check_result! ::Libuv::Ext.tcp_getpeername(handle, sockaddr, len)
197
- get_ip_and_port(::Libuv::Ext::Sockaddr.new(sockaddr), len.get_int(0))
198
- end
199
-
200
- def enable_nodelay
201
- return if @closed
202
- check_result ::Libuv::Ext.tcp_nodelay(handle, 1)
203
- end
204
-
205
- def disable_nodelay
206
- return if @closed
207
- check_result ::Libuv::Ext.tcp_nodelay(handle, 0)
208
- end
209
-
210
- def enable_keepalive(delay)
211
- return if @closed
212
- assert_type(Integer, delay, KEEPALIVE_ARGUMENT_ERROR)
213
- check_result ::Libuv::Ext.tcp_keepalive(handle, 1, delay)
214
- end
215
-
216
- def disable_keepalive
217
- return if @closed
218
- check_result ::Libuv::Ext.tcp_keepalive(handle, 0, 0)
219
- end
220
-
221
- def enable_simultaneous_accepts
222
- return if @closed
223
- check_result ::Libuv::Ext.tcp_simultaneous_accepts(handle, 1)
224
- end
225
-
226
- def disable_simultaneous_accepts
227
- return if @closed
228
- check_result ::Libuv::Ext.tcp_simultaneous_accepts(handle, 0)
229
- end
230
-
231
-
232
- private
233
-
234
-
235
- def create_socket(ip, port)
236
- if ip.ipv4?
237
- Socket4.new(loop, handle, ip.to_s, port)
238
- else
239
- Socket6.new(loop, handle, ip.to_s, port)
240
- end
241
- end
242
-
243
- def on_connect(req, status)
244
- ::Libuv::Ext.free(req)
245
- @connected = true
246
-
247
- begin
248
- @callback.call(self)
249
- rescue Exception => e
250
- @loop.log :error, :connect_cb, e
251
- end
252
- end
253
-
254
-
255
- class SocketBase
256
- include Resource
257
-
258
- def initialize(loop, tcp, ip, port)
259
- @tcp, @sockaddr = tcp, ip_addr(ip, port)
260
- end
261
-
262
- def bind
263
- check_result!(tcp_bind)
264
- end
265
-
266
- def connect(callback)
267
- check_result!(tcp_connect(callback))
268
- end
269
-
270
-
271
- protected
272
-
273
-
274
- def connect_req
275
- ::Libuv::Ext.create_request(:uv_connect)
276
- end
277
-
278
- def tcp_connect(callback)
279
- ::Libuv::Ext.tcp_connect(
280
- connect_req,
281
- @tcp,
282
- @sockaddr,
283
- callback
284
- )
285
- end
286
-
287
- def tcp_bind
288
- ::Libuv::Ext.tcp_bind(@tcp, @sockaddr)
289
- end
290
- end
291
-
292
-
293
- class Socket4 < SocketBase
294
- protected
295
-
296
-
297
- def ip_addr(ip, port)
298
- addr = Ext::SockaddrIn.new
299
- check_result! ::Libuv::Ext.ip4_addr(ip, port, addr)
300
- addr
301
- end
302
- end
303
-
304
-
305
- class Socket6 < SocketBase
306
- protected
307
-
308
-
309
- def ip_addr(ip, port)
310
- addr = Ext::SockaddrIn6.new
311
- check_result! ::Libuv::Ext.ip6_addr(ip, port, addr)
312
- addr
313
- end
314
- end
315
- end
1
+ require 'ipaddr'
2
+ require 'ruby-tls'
3
+
4
+
5
+ module Libuv
6
+ class TCP < Handle
7
+ include Stream, Net
8
+
9
+
10
+ KEEPALIVE_ARGUMENT_ERROR = "delay must be an Integer".freeze
11
+ TLS_ERROR = "TLS write failed".freeze
12
+
13
+
14
+ attr_reader :connected
15
+ # Check if tls active on the socket
16
+ def tls?; !@tls.nil?; end
17
+
18
+
19
+ def initialize(loop, acceptor = nil)
20
+ @loop = loop
21
+
22
+ tcp_ptr = ::Libuv::Ext.create_handle(:uv_tcp)
23
+ error = check_result(::Libuv::Ext.tcp_init(loop.handle, tcp_ptr))
24
+
25
+ if acceptor && error.nil?
26
+ error = check_result(::Libuv::Ext.accept(acceptor, tcp_ptr))
27
+ @connected = true
28
+ else
29
+ @connected = false
30
+ end
31
+
32
+ super(tcp_ptr, error)
33
+ end
34
+
35
+
36
+ #
37
+ # TLS Abstraction ----------------------
38
+ # --------------------------------------
39
+ #
40
+ def start_tls(args = {})
41
+ return unless @connected && @tls.nil?
42
+
43
+ @handshake = false
44
+ @pending_writes = []
45
+ @tls = ::RubyTls::Connection.new(self)
46
+ @tls.start(args)
47
+ end
48
+
49
+ # Push through any pending writes when handshake has completed
50
+ def handshake_cb
51
+ @handshake = true
52
+ writes = @pending_writes
53
+ @pending_writes = nil
54
+ writes.each do |deferred, data|
55
+ @pending_write = deferred
56
+ @tls.encrypt(data)
57
+ end
58
+ end
59
+
60
+ # This is clear text data that has been decrypted
61
+ # Same as stream.rb on_read for clear text
62
+ def dispatch_cb(data)
63
+ begin
64
+ @progress.call data, self
65
+ rescue Exception => e
66
+ @loop.log :error, :stream_progress_cb, e
67
+ end
68
+ end
69
+
70
+ # We resolve the existing tls write promise with a the
71
+ # real writes promise (a close may have occurred)
72
+ def transmit_cb(data)
73
+ if not @pending_write.nil?
74
+ @pending_write.resolve(direct_write(data))
75
+ @pending_write = nil
76
+ else
77
+ direct_write(data)
78
+ end
79
+ end
80
+
81
+ # Close can be called multiple times
82
+ def close_cb
83
+ if not @pending_write.nil?
84
+ @pending_write.reject(TLS_ERROR)
85
+ @pending_write = nil
86
+ end
87
+
88
+ # Shutdown the stream
89
+ close
90
+ end
91
+
92
+ # overwrite the default close to ensure
93
+ # pending writes are rejected
94
+ def close
95
+ @connected = false
96
+
97
+ if not @pending_writes.nil?
98
+ @pending_writes.each do |deferred, data|
99
+ deferred.reject(TLS_ERROR)
100
+ end
101
+ @pending_writes = nil
102
+ end
103
+
104
+ super
105
+ end
106
+
107
+ # Verify peers will be called for each cert in the chain
108
+ def verify_peer(&block)
109
+ @tls.verify_cb &block
110
+ end
111
+
112
+ alias_method :direct_write, :write
113
+ def write(data)
114
+ if @tls.nil?
115
+ direct_write(data)
116
+ else
117
+ deferred = @loop.defer
118
+
119
+ if @handshake == true
120
+ @pending_write = deferred
121
+ @tls.encrypt(data)
122
+ else
123
+ @pending_writes << [deferred, data]
124
+ end
125
+
126
+ deferred.promise
127
+ end
128
+ end
129
+ #
130
+ # END TLS Abstraction ------------------
131
+ # --------------------------------------
132
+ #
133
+
134
+ def bind(ip, port, callback = nil, &blk)
135
+ return if @closed
136
+ @on_listen = callback || blk
137
+ assert_type(String, ip, IP_ARGUMENT_ERROR)
138
+ assert_type(Integer, port, PORT_ARGUMENT_ERROR)
139
+
140
+ begin
141
+ @tcp_socket = create_socket(IPAddr.new(ip), port)
142
+ @tcp_socket.bind
143
+ rescue Exception => e
144
+ reject(e)
145
+ end
146
+ end
147
+
148
+ def open(fd, binding = true, callback = nil, &blk)
149
+ return if @closed
150
+ if binding
151
+ @on_listen = callback || blk
152
+ else
153
+ @callback = callback || blk
154
+ end
155
+ error = check_result UV.tcp_open(handle, fd)
156
+ reject(error) if error
157
+ end
158
+
159
+ def accept(callback = nil, &blk)
160
+ begin
161
+ raise RuntimeError, CLOSED_HANDLE_ERROR if @closed
162
+ tcp = TCP.new(loop, handle)
163
+ begin
164
+ (callback || blk).call(tcp)
165
+ rescue Exception => e
166
+ @loop.log :error, :tcp_accept_cb, e
167
+ end
168
+ rescue Exception => e
169
+ @loop.log :info, :tcp_accept_failed, e
170
+ end
171
+ nil
172
+ end
173
+
174
+ def connect(ip, port, callback = nil, &blk)
175
+ return if @closed
176
+ @callback = callback || blk
177
+ assert_type(String, ip, IP_ARGUMENT_ERROR)
178
+ assert_type(Integer, port, PORT_ARGUMENT_ERROR)
179
+
180
+ begin
181
+ @tcp_socket = create_socket(IPAddr.new(ip), port)
182
+ @tcp_socket.connect(callback(:on_connect))
183
+ rescue Exception => e
184
+ reject(e)
185
+ end
186
+ end
187
+
188
+ def sockname
189
+ return [] if @closed
190
+ sockaddr, len = get_sockaddr_and_len
191
+ check_result! ::Libuv::Ext.tcp_getsockname(handle, sockaddr, len)
192
+ get_ip_and_port(::Libuv::Ext::Sockaddr.new(sockaddr), len.get_int(0))
193
+ end
194
+
195
+ def peername
196
+ return [] if @closed
197
+ sockaddr, len = get_sockaddr_and_len
198
+ check_result! ::Libuv::Ext.tcp_getpeername(handle, sockaddr, len)
199
+ get_ip_and_port(::Libuv::Ext::Sockaddr.new(sockaddr), len.get_int(0))
200
+ end
201
+
202
+ def enable_nodelay
203
+ return if @closed
204
+ check_result ::Libuv::Ext.tcp_nodelay(handle, 1)
205
+ end
206
+
207
+ def disable_nodelay
208
+ return if @closed
209
+ check_result ::Libuv::Ext.tcp_nodelay(handle, 0)
210
+ end
211
+
212
+ def enable_keepalive(delay)
213
+ return if @closed
214
+ assert_type(Integer, delay, KEEPALIVE_ARGUMENT_ERROR)
215
+ check_result ::Libuv::Ext.tcp_keepalive(handle, 1, delay)
216
+ end
217
+
218
+ def disable_keepalive
219
+ return if @closed
220
+ check_result ::Libuv::Ext.tcp_keepalive(handle, 0, 0)
221
+ end
222
+
223
+ def enable_simultaneous_accepts
224
+ return if @closed
225
+ check_result ::Libuv::Ext.tcp_simultaneous_accepts(handle, 1)
226
+ end
227
+
228
+ def disable_simultaneous_accepts
229
+ return if @closed
230
+ check_result ::Libuv::Ext.tcp_simultaneous_accepts(handle, 0)
231
+ end
232
+
233
+
234
+ private
235
+
236
+
237
+ def create_socket(ip, port)
238
+ if ip.ipv4?
239
+ Socket4.new(loop, handle, ip.to_s, port)
240
+ else
241
+ Socket6.new(loop, handle, ip.to_s, port)
242
+ end
243
+ end
244
+
245
+ def on_connect(req, status)
246
+ ::Libuv::Ext.free(req)
247
+ @connected = true
248
+
249
+ begin
250
+ @callback.call(self)
251
+ rescue Exception => e
252
+ @loop.log :error, :connect_cb, e
253
+ end
254
+ end
255
+
256
+
257
+ class SocketBase
258
+ include Resource
259
+
260
+ def initialize(loop, tcp, ip, port)
261
+ @tcp, @sockaddr = tcp, ip_addr(ip, port)
262
+ end
263
+
264
+ def bind
265
+ check_result!(tcp_bind)
266
+ end
267
+
268
+ def connect(callback)
269
+ check_result!(tcp_connect(callback))
270
+ end
271
+
272
+
273
+ protected
274
+
275
+
276
+ def connect_req
277
+ ::Libuv::Ext.create_request(:uv_connect)
278
+ end
279
+
280
+ def tcp_connect(callback)
281
+ ::Libuv::Ext.tcp_connect(
282
+ connect_req,
283
+ @tcp,
284
+ @sockaddr,
285
+ callback
286
+ )
287
+ end
288
+
289
+ def tcp_bind
290
+ ::Libuv::Ext.tcp_bind(@tcp, @sockaddr)
291
+ end
292
+ end
293
+
294
+
295
+ class Socket4 < SocketBase
296
+ protected
297
+
298
+
299
+ def ip_addr(ip, port)
300
+ addr = Ext::SockaddrIn.new
301
+ check_result! ::Libuv::Ext.ip4_addr(ip, port, addr)
302
+ addr
303
+ end
304
+ end
305
+
306
+
307
+ class Socket6 < SocketBase
308
+ protected
309
+
310
+
311
+ def ip_addr(ip, port)
312
+ addr = Ext::SockaddrIn6.new
313
+ check_result! ::Libuv::Ext.ip6_addr(ip, port, addr)
314
+ addr
315
+ end
316
+ end
317
+ end
316
318
  end