felixge/node-ar-drone — pull request #86 by rschmukler (2013-12-09 02:54:41+00:00)
Title: Fixed TCPVideoStream trying to reconnect 2x

Currently, `TcpVideoStream` attempts to call the callback function `cb` of `TcpVideoStream.prototype.connect` on error. [TcpVideoStream.js#L43](https://github.com/felixge/node-ar-drone/blob/master/lib/video/TcpVideoStream.js#L43).

The problem with this is that [Client.js#78](https://github.com/rschmukler/node-ar-drone/blob/3bc3fe083839cca2deb5567506c9cbda8838babe/lib/Client.js#L78) also attaches a listener that attempts to reconnect.

The end result is that on disconnect, the video stream tries to reconnect 2x. This can result in it entering a failing loop where it is unable to connect.

This patch makes it so that the TcpVideoStream does not call `cb` on `error`. If you think about `.connect(cb)` it doesn't necessarily make sense that `cb` should be called on `error`.