Rather than:
callback(new TFramedTransport(frame));
This could be done:
(function(frame) {
process.nextTick(function() {
callback(new TFramedTransport(frame));
});
})(frame);
And then the state of the receiver does not get borked if callback
is bogus.