Hi Brad,
The code you posted is not sufficient to solve the problem. I think the response text may be formatted wrongly.
As I told you, when the sse transport is used, the normal response text looks like
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}
I have never used the libevent server, but it would be helpful if you would post the server side code as well as the plain response text in question like the above one. Also, first you can test that the connection following the server-sent events spec works correctly by using plain the EventSource object instead of using the portal. The portal use such a connection transparently. To do this, see
http://www.html5rocks.com/en/tutorials/eventsource/basics/
Note that the portal uses only the message event in the spec as message event in portal.
Thanks,