add write(), read() in socket