Added support for large chunks of data

Server was not performing well for large chunks of data, added support for counting bytes on the server to wait for more data from the stream when not full.