synchronize when writing/reading from tcp stream
release 7f88076