Skip to content

Commit

Permalink
adds error event to server
Browse files Browse the repository at this point in the history
  • Loading branch information
falconair committed Mar 6, 2011
1 parent 03eceb7 commit ef1de68
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fix.js
Expand Up @@ -46,7 +46,7 @@ function Server(func) {

var self = this;

this.stream = net.createServer(function(stream) {
this.server = net.createServer(function(stream) {

var session = this;

Expand Down Expand Up @@ -126,8 +126,10 @@ function Server(func) {
func(session.sessionEmitter);

});

self.server.on('error', function(err){ self.emit('error', err); });

this.listen = function(port, host, callback) { self.stream.listen(port, host, callback); };
this.listen = function(port, host, callback) { self.server.listen(port, host, callback); };
this.write = function(targetCompID, data) { self.sessions[targetCompID].write({data:data, type:'data'}); };
this.logoff = function(targetCompID, logoffReason) { self.sessions[targetCompID].write({data:{35:5, 58:logoffReason}, type:'data'}); };
this.kill = function(targetCompID, reason){ self.sessions[targetCompID].end(); };
Expand Down

0 comments on commit ef1de68

Please sign in to comment.