Global socket variable in sender class for closing it when stopping sending