init single thread client and sever socket communication