update connection setread and setwrite