refactored socket buffer readin
fixed phpcs error
Merge pull request #66 from zelgerj/master

refactored socket buffer readin