Realtime-One-To-One-Chat icon indicating copy to clipboard operation
Realtime-One-To-One-Chat copied to clipboard

DOMException: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.

Open aliahmadpasa101 opened this issue 5 years ago • 2 comments

Uncaught DOMException: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.

Getting above error on page refres

image h.

aliahmadpasa101 avatar Nov 12 '20 11:11 aliahmadpasa101

The message is being sent before the connection is established. in init function change setTimeout to 1000ms setTimeout(() => { var data = {'type' : 'login', 'name': userLogedIn}; conn.send(JSON.stringify(data)); },1000)

harendra21 avatar Nov 13 '20 09:11 harendra21

I want Notifications for other users in list if not a active chat. Also I want to store the messages in database and retrieve it from database if exist with load more functionality.

Do you have any idea how can I achieve this using web socket?

aliahmadpasa101 avatar Nov 13 '20 09:11 aliahmadpasa101