Receiving data code written and tested. All incoming data from same socket is appended to previosly received one. So there is no MAX_BUFFER_SIZE problem now. Only limit is sizeof your heap