Client disconnects once replicated string reaches 1024 characters

I am currently working on a multiplayer chat system, problem is that if a client player sends a message containing more than 1023 characters (including whitespace), it disconnects client. client disconnecting is apparently intended behavior (see a staff’s response: Client disconnecting while PIE - Multiplayer & Networking - Epic Developer Community Forums ). What I find interesting is that cut-off is at 1024, which I doubt is a coincidence due to that number being a power of 2. My variable holding message is a string, which is said to be 16 bytes per chararacter. 1024 characters at 16 bytes each is 16,384 bytes, which is 16 kibibytes. My thoughts are that this behavior is intended, though it does seem strange.

process of sending a message via my chat system is simple, a client player types in a message, message is sent to server, and has operations performed on string, and then server sends new message to each client player and displays it.

Edit: All of my variables were previously of type text, I switched them over because I thought that this would fix issue, but result is still same.

Hi Jamendxman3,

I wasn’t able to reproduce this in 4.9.1 binary. Are you able to reproduce this in a new project, or does it only occur in your current project? Does this occur in editor or in a packaged project? Please upload your Client and Server logs so I can take a look.

Can you put together a test project that displays this behavior and send me a download link? Thanks!

Well, I’m sure that my case may be a special case due to it being a chat system that does quite a few things, so it may be hard to pin-point it/reproduce in a test-project. Could you post your email or link me to your UE4 forum account? I am going to send link to original project that this is occurring in in a private message, this is happening inside of a blueprint for marketplace, so I’d like for it to not be shared.

I ended up finding you on forums, I’ve sent you a private message, thanks for you time.

Bump, any word on this?

Hi Jamendxman3,

I apologize for delay, it took me some time to narrow this down to a small enough project to examine. I was able to reproduce this in your project as well as a smaller test project, so I’ve entered a bug report for issue (UE-21827). I’ll post here if I see any update on it.

I believe you are correct and this may be a buffer overflow problem as mentioned in linked post, however I do not know whether that’s intentional given how small a 1024 character text or string is. My recommendation for your chat system would be to limit length of sent messages to 1023 characters for now.

Thanks for report!

G’day,

Posted this in response to someone about this limit on forums:
Is there any progress on 1024+ chars replication?

It breaks strings apart into chunks smaller then 1024 characters.
With a bit of modification, you can easily use it for chat messages.

Hope it helps.