HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-Atmosphere-tracking-id: 120c8b0f-b7ba-48d5-b9d5-f40d8e6c53c0
Expires: -1
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Content-Type: text/event-stream;charset=utf-8
Date: Wed, 22 May 2013 07:35:18 GMT
Content-Length: 2310
data: {"id":1,"type":"message","data":{"username":"Donghwan","message":"Hi Brad"},"reply":false}
data: {"id":2,"type":"message","data":{"username":"Donghwan","message":"How are you"},"reply":false}
data: {"id":3,"type":"heartbeat","data":null,"reply":false}
Greetings. My goal is to create a webapp that can be continually updated with data from a libevent-based server. The server uses chunk-transfer encoding, sending new data once per second. The simple test client has the code shown below. The streaming connection is created first (with the code below), then a JQuery post function is invoked to send a request to the server asking for a particular type of data. The server acknowledges the post request (the success handler sees the response), and, one second later, sends the first data item across the streaming connection. This first piece of data is detected by the "message" handler. Unfortunately, none of the subsequent data items trigger the "message" handler. To rule out the possibility that subsequent items were corrupt, I altered the server such that the same item is sent every time, but the behaviour is unchanged: the first item is detected, but none of the later items are seen. I've tried removing the server's acknowledgment of the post(), but that does not help. The "close" handler does not execute until the server is terminated, so the connection seems to survive.
Any idea?
$(function()
{
var transports = [ "sse" ];
portal.open("/blah", {transports: transports, timeout: false, heartbeat: false})
.on({
connecting: function()
{
console.log("Connecting with the transport [" + transports + "] (" + this.data("transport") + ").");
},
open: function()
{
console.log("Opened at " + portal.support.now());
},
message: function(data)
{
console.log("In message?");
},
close: function(reason)
{
console.log("Closed by the reason [" + reason + "]");
}
});
...
--
You received this message because you are subscribed to the Google Groups "Portal" group.
To unsubscribe from this group and stop receiving emails from it, send an email to portal_projec...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.