[ External Interface | Reference Manual | Alphabetic Index ]

peer_queue_create(+Queue, +Peer, +QueueType, +Direction, +Event)

Create a new peer queue Queue for Peer from ECLiPSe side.
Queue
Name of peer queue (atom)
Peer
Peer name (atom)
QueueType
Queue type (sync or async)
Direction
Queue direction (fromec, toec or bidirect)
Event
Event for peer queue (atom or event handle)

Description

Creates a new peer queue Queue for peer Peer from ECLiPSe side. The nature of queue created is specified by the other arguments (see the Embedding and interfacing manual for more details on peer queues):

QueueType
Type of the queue: either synchronous (sync) or asynchronous (async).
Direction
Direction of the synchronous queue: either from ECLiPSe to remote (fromec) or to ECLiPSe from remote (toec). This argument is ignored for asynchronous queues, which are bidirectional.
Event
Name or handle of event that will be raised on the ECLiPSe side when data arrives. Applicable only for data sent from remote side to ECLiPSe. If Event is the empty atom '', then no event will be associated with the peer queue.

This predicate will cause the queue to be created (if permitted by the remote side) on both the ECLiPSe and remote sides. Alternatively, the queue can be created from the remote side. Note in either case, the creation is done only on one side, and the created queue appears on the other side without an explicit creation there. Note also that if the queue is created on the ECLiPSe side, there is no way to name the handler on the remote side for data arriving on the remote side.

In the case of a remote peer, the queue is connected by a socket connection between the two sides. The server socket is created on the ECLiPSe side, and it will wait at most TimeOut seconds for the remote side to make the connection. TimeOut is the time specified in remote_connect_accept/6 when the remote peer was created. In addition, when the client socket connection is accepted, ECLiPSe checks to ensure that the client's host is the same as the one that formed the attachment. If not, then the connection is from someone else, and ECLiPSe will reject and close the queue connection.

Modes and Determinism

Fail Conditions

Peer is not a current peer.

Exceptions

(5) type error
QueueName, Peer or Event not of the correct type.
(6) out of range
QueueType or Direction not of permitted values.

See Also

peer_queue_close / 1, peer_queue_get_property / 3, remote_connect_accept / 6, event_create / 3