Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Force connection closure every 15 seconds to overcome heroku loadbala…

…ncer issues.
  • Loading branch information...
commit 64853997ea115c8e72fdd609a93328b1c59f55f1 1 parent 63c8826
@majek majek authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 gateway/server.js
View
8 gateway/server.js
@@ -45,12 +45,20 @@ sjs.on('open', function(s) {
s.send(msg);
};
console.log(id + " created");
+ var t = setInterval(function(){
+ try{
+ s.conn._session.recv.didClose();
+ } catch (x) {
+ }
+ }, 15000);
s.on('message', function(e) {
conn.publish('mud', {data: e.data,
'reply-to': 'mud-' + client_id,
id: id});
});
s.on('close', function() {
+ clearInterval(t);
+ t = null;
conn.publish('mud', {data: '',
closed: true,
'reply-to': 'mud-' + client_id,
Please sign in to comment.
Something went wrong with that request. Please try again.