[ ECLiPSe message passing built-in.|Group Index| Full Index]

mps_port_deallocate(+Port)

Deallocate a message passing port.

+Port
A port identifier (integer).

Description

Ports are the end-points of communication, ie. the points where messages are sent. A process that wants to receive communication needs to allocate a port and tell the port identifier to the potential senders. The senders, which will normally be other processes, possibly on remote machines, can then send messages to the port. The owner of the port, ie. the process that allocated it, can then receive the messages using mps_receive/2.

Ports are allocated and deallocated with the mps_port_allocate/2 and mps_port_deallocate/1 predicates. Note that deallocation of ports can be tricky because it is difficult to ensure that no messages to this port are under way.

Fail Conditions

None.

Resatisfiable

No.

Exceptions

(4) Instantiation fault
Port is not instantiated
(5) Type error
Port is not an integer
(176)
Message passing system error

Examples

   
    [eclipse 1]: mps_init(breeze).
    yes.
    [eclipse 2]: mps_port_allocate(true/0,Port).
    Port = 2050162692
    yes.
    [eclipse 3]: mps_send(2050162692,"Hello World !").
    yes.
    [eclipse 4]: mps_receive(2050162692, Message).
    Message = "Hello World !"
    yes.
    [eclipse 5]: mps_port_deallocate(2050162692).
    yes.
    [eclipse 6]: mps_exit. 
    yes.



See Also

mps_init / 1, mps_ping / 1, mps_exit / 0, mps_port_register / 4, mps_port_lookup / 3, mps_port_deregister / 3, mps_port_allocate / 2, mps_send / 2, mps_receive / 2