DoneJS StealJS jQuery ++ FuncUnit DocumentJS
3.0.0
2.3.27

 

  • Github
  • Twitter
  • Chat
  • Forum
  • Guides
  • Core
  • Ecosystem
    • can-construct-super
    • can-define-stream
    • can-fixture
    • can-fixture-socket
      • types
        • SocketEventListener
      • properties
        • Server
          • prototype
            • emit
            • on
            • onFeathersService
            • restore
        • requestHandlerToListener
        • storeToListeners
    • can-jquery
    • can-stache-converters
    • can-stream
    • can-vdom
    • can-view-import
    • can-zone
    • steal-stache
  • Infrastructure
  • Legacy
  • Bitovi
    • Bitovi.com
    • Blog
    • Consulting
    • Training
    • Open Source
  • Chat
  • Forum
  • Star
  • Follow @canjs
  • CanJS
  • /
  • Ecosystem
  • /
  • can-fixture-socket
  • /
  • Server
  • /
  • emit
  • / On this page
    • emit

      function

      Emits a socket event.

      • source

      server.emit(event, ...data, [ackFn])

      Emits a socket event.

      server.emit("news", data1, data2, function(ackData){
        console.log("Client acknowledged", ackData);
      });
      

      Parameters

      1. event {string}:

        The name of the socket event.

      2. data {*}:

        Data to be sent with the event. Socket.io allows to send more than one data objects.

      3. ackFn {function}:

        The acknowledgement function that will be executed if the receiver calls the acknowledgement callback.

      CanJS is part of DoneJS. Created and maintained by the core DoneJS team and Bitovi. Currently 3.0.0.