added server read and write from / to socket part