def setup_socket
      ctx = setup_certificate

      APN.log(:debug, "Connecting to #{@host}:#{@port}...")

      socket_tcp = TCPSocket.new(@host, @port)
      OpenSSL::SSL::SSLSocket.new(socket_tcp, ctx).tap do |s|
        s.sync = true
        s.connect
      end
    end
def setup_socket
      ctx = setup_certificate

      APN.log(:debug, "Connecting to #{@host}:#{@port}...")

      socket_tcp = TCPSocket.new(@host, @port)
      OpenSSL::SSL::SSLSocket.new(socket_tcp, ctx).tap do |s|
        s.sync = true
        s.connect
      end
    end
Open socket to Apple's servers