Actually there is an easier way to do this. I just did not find the correct class yesterday.
You can use these two handler on both sides and they will do the correct length prefixing and stripping. Important here is adding these handlers on both sides.
Thank you @FranzBusch. So it seems to work fine, my large messages now send great, but under a few situations it behaves interestingly.
Sometimes there is too much data in a message(looks like extra binary when I read a string from the buffer)
//An unrelated issue for the Prependers
On the server side the SSL Handler seems to work one time then throws an SSL error.
I am wondering if I am adding the handlers wrong. Both my server and client produce a NIOAsyncChannel and I then use that channel accordingly. Then Server producers a server channel and child channel. The client simply produces 1 NIOAsyncChannel that i read and write from. I limit Buffer size to 16mb.
@FranzBusch So I have a question in regards to Backpressure. I am trying to send about 300mb of data from my server to client. I have been able to send that amount of data from my client to server no problem. But when sending server to client the NIOAsyncChannelInboundStream seams to skip channelRead and goes straight to firing channelReadComplete. Which in turn seams to cause my device to loop continuously until the device crashes and never delivers the data. I assume this is due to the amount of data being fed into NIOTS and then passed to NIOAsyncChannelInboundStream. Would behavior like this be due to backpressure water mark?