implement socket communication but not completed yet