SouceCode:
服务器发送心跳数据包,然后将连接标记为活动状态,而无需等待客户端响应
private void CheckTimeoutAndKeepAlive(ConnectionMetadata metadata)
{
if (RaiseTimeout(metadata))
{
// If we're past the expiration time then just timeout the connection
metadata.Connection.Timeout();
java.io.EOFException: no more data available - expected end tag </stream:stream> to close start tag <stream:stream> from line 1, parser stopped on END_TAG seen ...</mechanisms></stream:features>... @1:344
at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:3035)
at org.xmlpull
下面是事件流的代码片段
但是,在客户端关闭浏览器后,它应该在控制台上打印“关闭活动流”字符串,但它没有。
def new_prizes_stream
begin
ap "open a live stream"
response.headers['Content-Type'] = 'text/event-stream'
redis = Redis.new
redis.subscribe('messages.create') do |on|
on.messag