Correctly reading from socketchannel

Fixed a few things