server and client mode implemented
sychronous read and write added