added ability to pull data from socket into buffer