Socket programming based on C/s mode