States for Recv.
Added retry on send, with partial fail
Removed superflouous var in writeData
Avoid AV on connection error
Fixed a bug with the new WriteData method
Thread Safety fix for Read Thread
Correction for a lock ommision