简体   繁体   中英

Message sent by server are not receiving on the client side

The message coming from one client is coming to the Java server. When a server sends this message to the another client, server showing "message sent" but that message is not received by the client in ws.onmessage block.

 var ws = new WebSocket("ws://localhost:8080/sampleWebsocket//serverendpointdemo/client1"); ws.onmessage = function(event) { alert("msg"); var str = event.data; } 

Thank you all for response to my question. The actual problem was because of my Redhat cloud. Cloud server was very slow that is why this problem came. When I tried to restart my server, that data was coming properly on my ws.onmessage block.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM