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