keep getting this error:

events.js:72
>         throw er; // Unhandled 'error' event
>               ^
> Error: read ECONNRESET
>     at errnoException (net.js:901:11)
>     at TCP.onread (net.js:556:19)


 I think it is the way I am setting up my connection with the API I am 
connecting to maybe?

here is a gist https://gist.github.com/hilukasz/6370943

otherwise here is the code: 

var Campfire = require("../lib/campfire").Campfire,
    express = require("express"),
    app =  require('express')(),
    server = require('http').createServer(app),
    io = require('socket.io').listen(server);
 
server.listen(1337);
 
app.set('views', __dirname + '/tpl');
app.set('view engine', "jade");
app.engine('jade', require('jade').__express);
app.use(express.static(__dirname + '/public'));
 
app.get("/", function(req, res){
  res.render("page");
});
 
  var instance = new Campfire({
    ssl     : true,
    token   : "MY_TOKEN",
    account : "MY_ACCOUNT"
  });
 
io.sockets.on('connection', function (socket) {
 
  //////////////////
  // people for lookup
  //////////////////
  var lukasz = {name: "Lukasz", id: 1231234, status: ""};
  var dana = {name: "Dana", id: 12341235, status: ""};
  var users = [lukasz, dana];
 
  function returnUsernameUsingID(userID){
      for (var j=0; j<users.length; j++) {
          if (users[j].id == userID) return users[j].name;
      }
      return -1;
  }
 
  ////////////////
  // Campfire
  ////////////////
 
  instance.join(123821, function(error, room) {
    room.listen(function(message) {
      if (message.body == "/wfh") {
        var username = returnUsernameUsingID(message.userId);
        room.speak(username+"("+message.userId+")"+ " is working from home");
        socket.emit('message', { message: username+",wfh" });
      }
      else {
        console.log("Received unknown message:");
        console.log(message);
      }
    });
  });
});


I am not quite sure what I am doing that would cause that error, any ideas?

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to