socket.emit() vs. socket.send()

后端 未结 6 1942
日久生厌
日久生厌 2020-12-02 04:04

What\'s the difference between these two?

I noticed that if I changed from socket.emit to socket.send in a working program, the server fail

6条回答
  •  广开言路
    2020-12-02 04:51

    https://socket.io/docs/client-api/#socket-send-args-ack

    socket.send // Sends a message event

    socket.emit(eventName[, ...args][, ack]) // you can custom eventName

提交回复
热议问题