Comparison

plugins/mod_c2s.lua @ 5638:c5b7f4858014

mod_c2s, mod_c2s: Send a whitespace on read timeout, to prod TCP into detecting if the connection died
author Kim Alvefur <zash@zash.se>
date Thu, 30 May 2013 14:32:40 +0200
parent 5571:ae9672f4079a
child 5668:5a9318ac92f6
comparison
equal deleted inserted replaced
5637:991b47778bf3 5638:c5b7f4858014
260 sm_destroy_session(session, err); 260 sm_destroy_session(session, err);
261 sessions[conn] = nil; 261 sessions[conn] = nil;
262 end 262 end
263 end 263 end
264 264
265 function listener.onreadtimeout(conn)
266 local session = sessions[conn];
267 if session then
268 return session.send(' ');
269 end
270 end
271
265 function listener.associate_session(conn, session) 272 function listener.associate_session(conn, session)
266 sessions[conn] = session; 273 sessions[conn] = session;
267 end 274 end
268 275
269 module:hook("server-stopping", function(event) 276 module:hook("server-stopping", function(event)