Reworked loop & socket read + refactorisation.

REFACTORED the loop & socket so that i can plug other platforms
CLEANED the sample
CLEANED architecture
UPDATED ByteArray