update writeBytes api to flash referenced. Fixed bug with randomly binary socket disconnect.