libuv 3.1.1 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 14a437923d19e87327fe1bdfd95c3a1d06df76db
4
- data.tar.gz: 6e4376bcc668ec20234d0c02cca5b6f1b31c218f
3
+ metadata.gz: 446bbc020013a6b723089b4f7bc1bc46f194f553
4
+ data.tar.gz: 02e7b5cf69ddab00f910bcec49a6929717ac9ae1
5
5
  SHA512:
6
- metadata.gz: 332ce9963f872229ef383807fd6376e1101d854bd934d313d908811b93c3723e3f8af703ff39b81734029c3811d7877652ca80a3a89a77bb83f84b96a9187ba1
7
- data.tar.gz: 9984c187e9017144b7f93dc68945fe2d94ef92eee46e23e863ef4545b96c25b47c003938235aeab61121e392fce0ffdc70924b5b02cac3ce3c521a5cf90dd6cb
6
+ metadata.gz: c050fc443903736c029bed696baec699775c50b0f7e9de485912c320f49650fffa9a6367ea78829147c2f99dc41be28441bf03c9a73b09626af3ce6bd8da4536
7
+ data.tar.gz: 2f37b2a6e5a311522ce6049d02d22db5c5d9b5a12e9e20fa577ba1c7085cdda0765207c4e75fb340a393df3ce6f3833e83730b9904c2dc294158078e2e0acdb7
data/lib/libuv/ext/ext.rb CHANGED
@@ -136,6 +136,7 @@ module Libuv
136
136
  attach_function :shutdown, :uv_shutdown, [:uv_shutdown_t, :uv_stream_t, :uv_shutdown_cb], :int, :blocking => true
137
137
 
138
138
  attach_function :tcp_init, :uv_tcp_init, [:uv_loop_t, :uv_tcp_t], :int, :blocking => true
139
+ attach_function :tcp_init_ex, :uv_tcp_init_ex, [:uv_loop_t, :uv_tcp_t, :uint], :int, :blocking => true
139
140
  attach_function :tcp_open, :uv_tcp_open, [:uv_tcp_t, :uv_os_sock_t], :int, :blocking => true
140
141
  attach_function :tcp_nodelay, :uv_tcp_nodelay, [:uv_tcp_t, :int], :int, :blocking => true
141
142
  attach_function :tcp_keepalive, :uv_tcp_keepalive, [:uv_tcp_t, :int, :uint], :int, :blocking => true
@@ -146,6 +147,7 @@ module Libuv
146
147
  attach_function :tcp_connect, :uv_tcp_connect, [:uv_connect_t, :uv_tcp_t, :sockaddr_in, :uv_connect_cb], :int, :blocking => true
147
148
 
148
149
  attach_function :udp_init, :uv_udp_init, [:uv_loop_t, :uv_udp_t], :int, :blocking => true
150
+ attach_function :udp_init_ex, :uv_udp_init_ex, [:uv_loop_t, :uv_udp_t, :uint], :int, :blocking => true
149
151
  attach_function :udp_open, :uv_udp_open, [:uv_udp_t, :uv_os_sock_t], :int, :blocking => true
150
152
  attach_function :udp_bind, :uv_udp_bind, [:uv_udp_t, :sockaddr_in, :uint], :int, :blocking => true
151
153
  attach_function :udp_getsockname, :uv_udp_getsockname, [:uv_udp_t, :pointer, :pointer], :int, :blocking => true
data/lib/libuv/reactor.rb CHANGED
@@ -320,17 +320,15 @@ module Libuv
320
320
  # Get a new TCP instance
321
321
  #
322
322
  # @return [::Libuv::TCP]
323
- def tcp(callback = nil, &blk)
324
- callback ||= blk
325
- TCP.new(@reactor, progress: callback)
323
+ def tcp(callback = nil, **opts, &blk)
324
+ TCP.new(@reactor, progress: callback || blk, **opts)
326
325
  end
327
326
 
328
327
  # Get a new UDP instance
329
328
  #
330
329
  # @return [::Libuv::UDP]
331
- def udp(callback = nil, &blk)
332
- callback ||= blk
333
- UDP.new(@reactor, progress: callback)
330
+ def udp(callback = nil, **opts, &blk)
331
+ UDP.new(@reactor, progress: callback || blk, **opts)
334
332
  end
335
333
 
336
334
  # Get a new TTY instance
data/lib/libuv/tcp.rb CHANGED
@@ -22,12 +22,16 @@ module Libuv
22
22
  def tls?; !@tls.nil?; end
23
23
 
24
24
 
25
- def initialize(reactor, acceptor = nil, progress: nil)
25
+ def initialize(reactor, acceptor = nil, progress: nil, flags: nil)
26
26
  @reactor = reactor
27
27
  @progress = progress
28
28
 
29
29
  tcp_ptr = ::Libuv::Ext.allocate_handle_tcp
30
- error = check_result(::Libuv::Ext.tcp_init(reactor.handle, tcp_ptr))
30
+ error = if flags
31
+ check_result(::Libuv::Ext.tcp_init_ext(reactor.handle, tcp_ptr, flags))
32
+ else
33
+ check_result(::Libuv::Ext.tcp_init(reactor.handle, tcp_ptr))
34
+ end
31
35
 
32
36
  if acceptor && error.nil?
33
37
  error = check_result(::Libuv::Ext.accept(acceptor, tcp_ptr))
data/lib/libuv/udp.rb CHANGED
@@ -20,12 +20,16 @@ module Libuv
20
20
  HANDLE_CLOSED_ERROR = "unable to send as handle closed"
21
21
 
22
22
 
23
- def initialize(reactor, progress: nil)
23
+ def initialize(reactor, progress: nil, flags: nil)
24
24
  @reactor = reactor
25
25
  @progress = progress
26
26
 
27
27
  udp_ptr = ::Libuv::Ext.allocate_handle_udp
28
- error = check_result(::Libuv::Ext.udp_init(reactor.handle, udp_ptr))
28
+ error = if flags
29
+ check_result(::Libuv::Ext.udp_init_ex(reactor.handle, udp_ptr, flags))
30
+ else
31
+ check_result(::Libuv::Ext.udp_init(reactor.handle, udp_ptr))
32
+ end
29
33
  @request_refs = {}
30
34
 
31
35
  super(udp_ptr, error)
data/lib/libuv/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Libuv
4
- VERSION = '3.1.1'
4
+ VERSION = '3.1.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libuv
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 3.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen von Takach
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-15 00:00:00.000000000 Z
11
+ date: 2016-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi