server write and read