Make a max buffering size configurable and if exceed throw a TooLongFrameException. Just to guard against DOS