previous up next
Go backward to send: Sending a Message
Go up to 5.3 Basic Communication
RISC-Linz logo

receive: Receiving a Mesage

m = c.receive()
  Message m
  InChannel c
m = c.receive(t)
  Message m
  InChannel c
  int t;

The first variant returns a message from channel c; if c is empty, the current node is blocked until c becomes non-empty.

The second variant behaves like the first one except for the fact that the current node is blocked for at most t time units. If then c is still empty, null is returned.

Which message is returned from c depends on the selector associated to c; by default, this is the oldest message held by c.


Maintainer: Wolfgang Schreiner
Last Modification: October 1, 1998

previous up next