close

fun close()(source)

The close() method of the MessagePort interface disconnects the port, so it is no longer active.

MDN Reference