using Socket#gets and Socket#puts only