Synchronous request with Websockets

前端 未结 5 2141
一生所求
一生所求 2020-12-30 04:04

I can send and receive messages from server on websockets. I need to write a function that will send data to the server and is awaiting a response from the server and then r

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-30 04:47

    I think the project WebSockets-Callback would be easier to use

    wscb.send({cmd: 'Hello server!'},
        function(response){
            //do something...
        }
    )
    

提交回复
热议问题