handle closed socker without gross panic