This API is available on Firefox OS for privileged or certified applications only.


The ondrain property is used to specify an event handler to receive drain events. Those events are triggered each time buffered data are flushed to the network.


instanceOfTCPSocket.ondrain = funcRef

Where funcRef is a function to be called when the drain event occurs.

This callback function will get a TCPSocketEvent object as its first parameter.



Not part of any specification yet; however, this API is discussed at W3C as part of the System Applications Working Group under the Raw Sockets proposal.

See also