listen for socket errors so that you can emit errors on its behalf