Merge pull request #128 from hybridgroup/add-stop-to-connection
Add a stop function to the base connection class.
This commit is contained in:
commit
d702d1077a
|
@ -102,6 +102,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