Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. Example that does work
  2. setTimeout((function (_this) {
  3. _this.logger.debug("Trying to connect to TCP");
  4. _this.client.connect(_this.PORT, _this.HOST, (function(_this) {
  5. _this.logger.info("TCP connection success on %s:%s", _this.HOST, _this.PORT);
  6. })(_this))
  7. })(this), this.timeout * 1000);
  8.  
  9. Example that doesn't work
  10. this.client.on("error", (function(_this) {
  11. _this.connected = false;
  12. _this.logger.debug("Can't connect, trying to reconnect.");
  13. _this.connect();
  14. })(this));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement