 Sudden Connection Termination 
I am currently working on a chat app. I was able to connect, send and receive messages between clients. It was all going well. Except that i am having a slight issue that I cannot find the solutions anywhere. On the first time the client sends a message, their connection gets terminated, then automatically reconnects once again. There's no Error occurring. it just disconnects and reconnects automatically. 

What are the usual causes for this? is there any way to prevent this? 

Here's a link to the chat app im working on. its still unfinished. 

https://github.com/jovelluna12/phpratchet-chat-realtime
