apns_simple 0.8.1 → 0.9.0

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
  SHA1:
3
- metadata.gz: eec0b4e04de00e365c95c6c74dc18dbd832dfb16
4
- data.tar.gz: 5aaecd12d555f4745abc64d908b29ea6614f31fb
3
+ metadata.gz: 0e9d10c4b40b0eec209b3df3a4e4efd902d346e0
4
+ data.tar.gz: 545ce5885e94bab878faeb1ff11c030d89986fc7
5
5
  SHA512:
6
- metadata.gz: d665e823c3d2e01c716274c847411fa671f7024ca84e30a1f35eb9720b0cfa4d04293140f724e96a593b5fc90855521a8e0d73c91d51f88c24e54af1637fc75f
7
- data.tar.gz: f4a4ad5eb5a5aab4a6b8d041601295d5cc03ab0bb661a78c8a85c23912666160437341efac0e0c4fa5ef3a2f03bd8f1df1f93fd6fc9172ec4e601e5a023efcac
6
+ metadata.gz: 9f923b01bae484adf92cc5b9919f4c1b9857f8db414a32ec8558cdc6e2fbb222b9cf215a3514fa546c9b8636abb43e46c92d4dea4ff9704b82c6647064af02dc
7
+ data.tar.gz: 71bbe0c86313f74c58f6ce27a500a06dd397f1549ca52f065564a13461eddbf2de4c23e7f5eb674a5f3f43b20f562c2b4b692b153a1617454cd6f0401b57aaef
@@ -50,12 +50,17 @@ module ApnsSimple
50
50
  ssl.write(notification.payload)
51
51
  ssl.flush
52
52
 
53
- unless IO.select([ssl], nil, nil, TIMEOUT)
53
+ result = IO.select([ssl], nil, nil, TIMEOUT)
54
+
55
+ unless result
54
56
  notification.error = "No response from APNS server received in #{TIMEOUT} seconds. Exit by timeout."
55
57
  return
56
58
  end
57
59
 
58
- if (error = ssl.read(6))
60
+ readables = result.first # Array of readable sockets.
61
+ readable_ssl_socket = readables.first # Find one and only socket we are watching.
62
+
63
+ if (error = readable_ssl_socket.read(6))
59
64
  command, status, _index = error.unpack("ccN")
60
65
  notification.error = command == COMMAND ? "#{status}: #{CODES[status]}" : "Unknown command received from APNS server: #{command}"
61
66
  end
@@ -1,3 +1,3 @@
1
1
  module ApnsSimple
2
- VERSION = '0.8.1'
2
+ VERSION = '0.9.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apns_simple
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Voronkov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-11-27 00:00:00.000000000 Z
11
+ date: 2015-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler