Sounds good to me.


On Tue, Feb 4, 2014 at 4:42 PM, Sean Massa <notifications@github.com> wrote:

> In lib/portscanner.js:
>
> >          foundPort = true
> >          callback(null, port)
> >        }
> > +      else if (error) {
> > +        callback(error)
> > +      }
>
> I think I understand the problem. If you are looking for a closed port,
> you will only see an error.
>
> It looks like closed and error are always together. So, this change looks
> like it would work as expected, but I think we should expose both. What do
> you think about this change?
>
> if (statusOfPort === status) {
>   foundPort = true
>   callback(error, port)}else if (error) {
>   callback(error)}
>
> So, if the status matches, we pass along the error as well (which is null
> in the "open" case and populated in the "closed" case). That way, if you
> care about the error, you can inspect it.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/baalexander/node-portscanner/pull/13/files#r9442623>
> .
>



-- 
Austin Fatheree
RIVVIR Consulting
http://www.rivvir.com
austin@rivvir.com
832-483-0741
twitter: @afat http://twitter.com/afat