Add a stop function to the base connection class.
This commit is contained in:
parent
1de8ef594d
commit
d54c9419af
|
@ -101,6 +101,19 @@ namespace("Cylon", function() {
|
|||
return this.robot.initAdaptor(opts.adaptor, this.self, opts);
|
||||
};
|
||||
|
||||
// Public: Stop the adaptor's connection
|
||||
//
|
||||
// Returns nothing
|
||||
Connection.prototype.stop = function() {
|
||||
var msg;
|
||||
msg = "Stopping adaptor '" + this.name + "'";
|
||||
if (this.port != null) {
|
||||
msg += " on port '" + (this.port.toString()) + "'";
|
||||
}
|
||||
Logger.info(msg);
|
||||
return this.disconnect();
|
||||
};
|
||||
|
||||
return Connection;
|
||||
|
||||
})(EventEmitter);
|
||||
|
|
Loading…
Reference in New Issue