{"action":"created","issue":{"url":"https://api.github.com/repos/mscdex/ssh2/issues/222","labels_url":"https://api.github.com/repos/mscdex/ssh2/issues/222/labels{/name}","comments_url":"https://api.github.com/repos/mscdex/ssh2/issues/222/comments","events_url":"https://api.github.com/repos/mscdex/ssh2/issues/222/events","html_url":"https://github.com/mscdex/ssh2/issues/222","id":55968710,"number":222,"title":"Multiple concurrent exec calls fail","user":{"login":"cbosuna","id":4278753,"avatar_url":"https://avatars.githubusercontent.com/u/4278753?v=3","gravatar_id":"","url":"https://api.github.com/users/cbosuna","html_url":"https://github.com/cbosuna","followers_url":"https://api.github.com/users/cbosuna/followers","following_url":"https://api.github.com/users/cbosuna/following{/other_user}","gists_url":"https://api.github.com/users/cbosuna/gists{/gist_id}","starred_url":"https://api.github.com/users/cbosuna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbosuna/subscriptions","organizations_url":"https://api.github.com/users/cbosuna/orgs","repos_url":"https://api.github.com/users/cbosuna/repos","events_url":"https://api.github.com/users/cbosuna/events{/privacy}","received_events_url":"https://api.github.com/users/cbosuna/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-01-29T22:43:54Z","updated_at":"2015-05-29T18:58:51Z","closed_at":"2015-01-30T00:04:46Z","body":"```javascript\r\nconn.exec('uptime', function(err, stream) {\r\n  if (err) throw err;\r\n  stream.on('close', function(code, signal) {\r\n    console.log('Stream :: close :: code: ' + code + ', signal: ' + signal);\r\n    conn.exec('uptime', function(err, stream) {\r\n        if (err) throw err;\r\n        stream.on('close', function(code, signal) {\r\n          console.log('Stream :: close :: code: ' + code + ', signal: ' + signal);\r\n          //conn.end();\r\n        }).on('data', function(data) {\r\n          console.log('STDOUT: ' + data);\r\n        }).stderr.on('data', function(data) {\r\n          console.log('STDERR: ' + data);\r\n        });\r\n      });\r\n  }).on('data', function(data) {\r\n    console.log('STDOUT: ' + data);\r\n  }).stderr.on('data', function(data) {\r\n    console.log('STDERR: ' + data);\r\n  });\r\n});\r\n```\r\n\r\nworks (serial)\r\n\r\n```javascript\r\nconn.exec('uptime', function(err, stream) {\r\n  if (err) throw err;\r\n  stream.on('close', function(code, signal) {\r\n    console.log('Stream :: close :: code: ' + code + ', signal: ' + signal);\r\n  }).on('data', function(data) {\r\n    console.log('STDOUT: ' + data);\r\n  }).stderr.on('data', function(data) {\r\n    console.log('STDERR: ' + data);\r\n  });\r\n});\r\nconn.exec('uptime', function(err, stream) {\r\n  if (err) throw err;\r\n  stream.on('close', function(code, signal) {\r\n    console.log('Stream :: close :: code: ' + code + ', signal: ' + signal);\r\n  }).on('data', function(data) {\r\n    console.log('STDOUT: ' + data);\r\n  }).stderr.on('data', function(data) {\r\n    console.log('STDERR: ' + data);\r\n  });\r\n});\r\n```\r\n\r\nFails"},"comment":{"url":"https://api.github.com/repos/mscdex/ssh2/issues/comments/106903788","html_url":"https://github.com/mscdex/ssh2/issues/222#issuecomment-106903788","issue_url":"https://api.github.com/repos/mscdex/ssh2/issues/222","id":106903788,"user":{"login":"bjester-ss","id":2325472,"avatar_url":"https://avatars.githubusercontent.com/u/2325472?v=3","gravatar_id":"","url":"https://api.github.com/users/bjester-ss","html_url":"https://github.com/bjester-ss","followers_url":"https://api.github.com/users/bjester-ss/followers","following_url":"https://api.github.com/users/bjester-ss/following{/other_user}","gists_url":"https://api.github.com/users/bjester-ss/gists{/gist_id}","starred_url":"https://api.github.com/users/bjester-ss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjester-ss/subscriptions","organizations_url":"https://api.github.com/users/bjester-ss/orgs","repos_url":"https://api.github.com/users/bjester-ss/repos","events_url":"https://api.github.com/users/bjester-ss/events{/privacy}","received_events_url":"https://api.github.com/users/bjester-ss/received_events","type":"User","site_admin":false},"created_at":"2015-05-29T18:58:51Z","updated_at":"2015-05-29T18:58:51Z","body":"So I'm curious, does this mean `exec` goes through authentication with the server every call?  I know I can use `shell` and just push commands to it, but in order to wait for each to be done, I need to check for prompt correct?"}}