Added asynchronous reading and writing on client side.