Changed socket error handler to handle 'ECONNREFUSED'. In event of ECONN...

...REFUSED the port is available