for the moment, use one char reading at a time using recv, which is inefficient.