Commit af5df00f authored by Benjamin Chelli's avatar Benjamin Chelli

remove the connect function and make it called implicitly by every single...

remove the connect function and make it called implicitly by every single function trying to interact with the share
parent 59423dd3
......@@ -24,26 +24,18 @@ var s = new SMB2({
, password:'password!'
});
// negotiate the connection with the server
s.connect(function(err){
// read the content of the folder
s.readDir('Windows\\System32', function(err, files){
// if an error happen => throw it
if(err) throw err;
// read the content of the folder
s.readDir('Windows\\System32', function(err, files){
// if an error happen => throw it
if(err) throw err;
// display content in the console
console.log(files);
// close the connection
s.close();
});
// display content in the console
console.log(files);
// close the connection
s.close();
});
```
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment