close

open override fun close()(source)

The close() method of the MessagePort interface disconnects the port, so it is no longer active. This stops the flow of messages to that port.

MDN Reference