I did that, and still the log saids to me that recive two cmd....
executes the "VOTO" code, two times, i try it from the javascript
client (JSF) and it does it once, I have no idea why with the java
client comes up with that....

I also try the tutorial example from the web site:

public String push(String server, int port, String idPoll, String
keyword)
                        throws JSONException {
                /*
                 * try{ //URL url = new URL (server+
                 * "[{%22cmd%22:%22inlinepush%22,%22params%22:{%22password
%22:%22testpasswd%22,%22raw%22:%22raw%22,%22channel%22:%22"
                 * 
+idPoll+"%22,%22data%22:{%22keyword%22:%22"+keyword+"%22}}}]");
URL
                 * url = new URL
                 * 
(server+"[{%22cmd%22:%22VOTO%22,%22params%22:{%22encuesta%22:%22"
                 * +idPoll+"%22,%22key%22:%22"+keyword+"%22}}]"); URLConnection
                 * connection = url.openConnection(); //connection.connect();
                 * //System.out.println(connection.getContent().toString());
                 * connection.getContentLength();
                 * //System.out.println(connection.getContent().toString()); } 
catch
                 * (Exception e) { return ("error [inlinePush JAVA]:
"+e.getMessage());
                 * } return ("Success, vote registered  ");
                 */

                String channel = "testchannel";
                JSONObject root = new JSONObject();
                JSONObject message = new JSONObject();
                message.put("encuesta", idPoll);
                message.put("key", keyword);
                root.put("params", message);
                root.put("channel", channel);
                root.put("cmd", "VOTO");
                String string = root.toString();

                try {
                        Socket socket = new Socket(server, port);
                        PrintWriter out = new 
PrintWriter(socket.getOutputStream(), true);

                        out.println(string);
                        out.close();
                        socket.close();
                } catch (Exception e) {
                        e.printStackTrace();
                }

                return string;
        }

And the log say this error:

2011-08-18 17:00:17 - src/http.c:493 - Invalid HTTP method in request:
{"cmd":"VOTO","params":
{"encuesta":"1909","key":"P0AIBE"},"channel":"testchannel"}



On 18 ago, 16:16, Nathan Tran <[email protected]> wrote:
> Your server string should be:http://www.myapeserver.com:6969/0/the zero
> indicates that you are using long polling.
>
> Nathan.

-- 
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/

Reply via email to