[control station] Fixes some bugs and add close Socket