MessagePortMain is the main-process-side equivalent of the DOM
MessagePort object. It behaves similarly to the DOM version, with the
exception that it uses the Node.js
EventEmitter event system, instead of the
EventTarget system. This means you should use
to listen for events, instead of
port.onmessage = ... or
See the Channel Messaging API documentation for more information on using channel messaging.
MessagePortMain is an [EventEmitter][event-emitter].
Port interface for channel messaging in the main process.
This class is not exported from the
'electron' module. It is only available as a return value of other methods in the Electron API.
Sends a message from the port, and optionally, transfers ownership of objects to other browsing contexts.
Starts the sending of messages queued on the port. Messages will be queued until this method is called.
Disconnects the port, so it is no longer active.
Emitted when a MessagePortMain object receives a message.
Emitted when the remote end of a MessagePortMain object becomes disconnected.