I currently have an Apple Push Notification running on my server in Ruby. I would like me to go to Erlang because I would like to use a supervisor to keep track of him. Does anyone have a code with which they could help?
Here is my Ruby code. One thing I donβt like about this current implementation is that it doesnβt seem to be in touch - it disconnects 2-3 times a day, and it seems that after I reconnect, the first pressing will not work:
context = OpenSSL::SSL::SSLContext.new context.cert = OpenSSL::X509::Certificate.new(File.read(cert)) context.key = OpenSSL::PKey::RSA.new(File.read(cert)) def connect_sockets(server, context) sock = TCPSocket.new(server, 2195) ssl = OpenSSL::SSL::SSLSocket.new(sock,context) ssl.connect return sock, ssl end sock, ssl = connect_sockets(server, context)
If Erlang Push is not feasible, I would not mind sticking to my Ruby as long as I can keep my contacts alive and possibly control it through Erlang. Does anyone know if this is possible?
source share