From 3fb6edcf618cc56b29d8543310791d2d08878dfe Mon Sep 17 00:00:00 2001 From: Jeremy Tregunna Date: Thu, 17 Mar 2011 23:07:30 -0400 Subject: [PATCH] Fixed #11256615 in pivotal tracker. feedback client now implemented --- lib/apnserver.rb | 1 + lib/apnserver/feedback_client.rb | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 lib/apnserver/feedback_client.rb diff --git a/lib/apnserver.rb b/lib/apnserver.rb index 8731c53..e46be09 100644 --- a/lib/apnserver.rb +++ b/lib/apnserver.rb @@ -2,3 +2,4 @@ require 'apnserver/payload' require 'apnserver/notification' require 'apnserver/client' +require 'apnserver/feedback_client' diff --git a/lib/apnserver/feedback_client.rb b/lib/apnserver/feedback_client.rb new file mode 100644 index 0000000..d8bf251 --- /dev/null +++ b/lib/apnserver/feedback_client.rb @@ -0,0 +1,17 @@ +# Feedback service + +module ApnServer + class FeedbackClient < Client + def initialize(pem, host = 'feedback.push.apple.com', port = 2196, pass = nil) + @pem, @host, @port, @pass = pem, host, port, pass + end + + def read + records ||= [] + while record = @ssl.read(38) + records << record.unpack("NnH*") + end + records + end + end +end \ No newline at end of file