Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

close method

Closes a MessagePort from an existing MessageChannel.

HTML5 Web Messaging

Syntax

MessagePort.close();

Parameters

This method has no parameters.

Return value

This method does not return a value.

Standards information

Remarks

This method releases the MessagePort from its corresponding MessagePort. After calling the close method, message events will no longer be received on this port and postMessage will no longer post any messages. To continue messaging, you need to create a new MessageChannel and resend one of the ports to the other window or document.

For more info, see MessageChannel for a working messaging demo.

See also

MessagePort
Worker
MessageChannel
Web worker demo

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.