libuv 1.1.1 → 1.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: dddec388d36bbe88b300143de8aafff0a78472c2
4
- data.tar.gz: d269f7edc49825009454fdb7f86a6cd31d31ed6b
3
+ metadata.gz: abd50822e358932d098affc895bbb2140f49769f
4
+ data.tar.gz: 27fc81ccc78e0feb4e2832d92089e93444c95f0b
5
5
  SHA512:
6
- metadata.gz: 666a607295cf555956df1b520c137208438086c8a79dad5956385bacf53bb20bc7b8d380931b67e9926ba6899b8b8c1fa51b7a8ff0c7ec1c87c4ea40e487545f
7
- data.tar.gz: 201e8c597aad69f29e23ed62430f38b57a588ea9cd1bee0173db54e5d7c3a21a7e17efbcd6ed581a722340d17e80a6381af3cf46f03fd877f1fa1fc43e6b2c45
6
+ metadata.gz: 9ac195af2e4184164bb56fc5fb5d7155bbcd61c0b995f2d601f3e194257a41366e22f1f34d5425a119537e1def895caf19f4ce9fa98a8117c6be85b4131aec74
7
+ data.tar.gz: 9be5705fb74dc2726be9360a002d47343556f0ebce42cf78686ae606fdd4837b7c94d2c37daaab9f6eaf2a50f91e70eb057cbafe55c5237393b60ab536774f72
data/lib/libuv/error.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  module Libuv
2
2
  class Error < StandardError
3
+ class E2BIG < Error; end
3
4
  class EACCES < Error; end
4
5
  class EADDRINUSE < Error; end
5
6
  class EADDRNOTAVAIL < Error; end
@@ -19,7 +20,6 @@ module Libuv
19
20
  class EAI_PROTOCOL < Error; end
20
21
  class EAI_SERVICE < Error; end
21
22
  class EAI_SOCKTYPE < Error; end
22
- class EAI_SYSTEM < Error; end
23
23
  class EALREADY < Error; end
24
24
  class EBADF < Error; end
25
25
  class EBUSY < Error; end
@@ -64,8 +64,6 @@ module Libuv
64
64
  class EPROTONOSUPPORT < Error; end
65
65
  class EPROTOTYPE < Error; end
66
66
  class ERANGE < Error; end
67
- class ENXIO < Error; end
68
- class EMLINK < Error; end
69
67
  class EROFS < Error; end
70
68
  class ESHUTDOWN < Error; end
71
69
  class ESPIPE < Error; end
@@ -75,5 +73,8 @@ module Libuv
75
73
  class EXDEV < Error; end
76
74
  class UNKNOWN < Error; end
77
75
  class EOF < Error; end
76
+ class ENXIO < Error; end
77
+ class EMLINK < Error; end
78
+ class EHOSTDOWN < Error; end
78
79
  end
79
80
  end
@@ -39,8 +39,7 @@ module Libuv
39
39
  end
40
40
 
41
41
  class SockaddrIn < FFI::Struct
42
- layout :sin_len, :uint8,
43
- :sin_family, :sa_family_t,
42
+ layout :sin_family, :sa_family_t,
44
43
  :sin_port, :in_port_t,
45
44
  :sin_addr, InAddr,
46
45
  :sin_zero, [:char, 8]
data/lib/libuv/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Libuv
2
- VERSION = '1.1.1'
2
+ VERSION = '1.1.2'
3
3
  end
data/spec/udp_spec.rb ADDED
@@ -0,0 +1,74 @@
1
+ require 'libuv'
2
+ require 'thread'
3
+
4
+
5
+ describe Libuv::UDP do
6
+ before :each do
7
+ @log = []
8
+ @general_failure = []
9
+
10
+ @loop = Libuv::Loop.new
11
+ @server = @loop.udp
12
+ @client = @loop.udp
13
+ @timeout = @loop.timer do
14
+ @loop.stop
15
+ @general_failure << "test timed out"
16
+ end
17
+ @timeout.start(5000)
18
+
19
+ @loop.all(@server, @client, @timeout).catch do |reason|
20
+ @general_failure << reason.inspect
21
+ end
22
+ end
23
+
24
+ describe 'basic client server' do
25
+ it "should send a ping and return a pong", :network => true do
26
+ @loop.run { |logger|
27
+ logger.progress do |level, errorid, error|
28
+ begin
29
+ @general_failure << "Log called: #{level}: #{errorid}\n#{error.message}\n#{error.backtrace.join("\n") if error.backtrace}\n"
30
+ rescue Exception => e
31
+ @general_failure << "error in logger #{e.inspect}"
32
+ end
33
+ end
34
+
35
+
36
+ @server.bind('127.0.0.1', 34567)
37
+ @server.progress do |data, ip, port, server|
38
+ @log << data
39
+ server.send(ip, port, 'pong')
40
+ end
41
+ @server.start_read
42
+
43
+ # catch errors
44
+ @server.catch do |reason|
45
+ @general_failure << reason.inspect
46
+ end
47
+
48
+
49
+ # connect client to server
50
+ @client.bind('127.0.0.1', 34568)
51
+ @client.progress do |data, ip, port, client|
52
+ @log << data
53
+ client.close
54
+ end
55
+ @client.start_read
56
+ @client.send('127.0.0.1', 34567, 'ping')
57
+
58
+ # catch errors
59
+ @client.catch do |reason|
60
+ @general_failure << reason.inspect
61
+ end
62
+
63
+ # close the handle
64
+ @client.finally do
65
+ @server.close
66
+ @loop.stop
67
+ end
68
+ }
69
+
70
+ expect(@log).to eq(['ping', 'pong'])
71
+ expect(@general_failure).to eq([])
72
+ end
73
+ end
74
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libuv
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bulat Shakirzyanov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-11-04 00:00:00.000000000 Z
12
+ date: 2015-02-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi
@@ -193,7 +193,6 @@ files:
193
193
  - ext/libuv/libuv.pc.in
194
194
  - ext/libuv/m4/.gitignore
195
195
  - ext/libuv/m4/as_case.m4
196
- - ext/libuv/m4/dtrace.m4
197
196
  - ext/libuv/m4/libuv-check-flags.m4
198
197
  - ext/libuv/samples/.gitignore
199
198
  - ext/libuv/samples/socks5-proxy/.gitignore
@@ -477,6 +476,7 @@ files:
477
476
  - spec/idle_spec.rb
478
477
  - spec/pipe_spec.rb
479
478
  - spec/tcp_spec.rb
479
+ - spec/udp_spec.rb
480
480
  homepage: https://github.com/cotag/libuv
481
481
  licenses:
482
482
  - MIT
@@ -497,7 +497,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
497
497
  version: '0'
498
498
  requirements: []
499
499
  rubyforge_project:
500
- rubygems_version: 2.2.2
500
+ rubygems_version: 2.4.5
501
501
  signing_key:
502
502
  specification_version: 4
503
503
  summary: libuv bindings for Ruby
@@ -511,4 +511,5 @@ test_files:
511
511
  - spec/idle_spec.rb
512
512
  - spec/pipe_spec.rb
513
513
  - spec/tcp_spec.rb
514
+ - spec/udp_spec.rb
514
515
  has_rdoc: