use socket in another thread