Transport Layer Prolog API (Version 1.20) ========================================= The "transport" module is intended for sending and receiving composed message. To compose/decompose messages, please use the "message_format" module. If you want to (de)compose and send/receive messages, please use the "messaging" module instead. Intialization & Shutdown ------------------------ 1. Initialize Transport Layer tp_init_transport(Parameters_with_value) Initialize the transport layer and get ready for communication. "Parameters_with_value" is a list of parameters with values specific to the communication platform. It is in the form: [arg1:value1, arg2:value2, ...]. Supported arguments: server_host: host name of Linda server *** This is a compulsory argument. server_port: port no. of Linda server *** This is a compulsory argument. id: The Id generator mode, which is one of "counter/random/very_random". If the mode is not specified, the default mode is the un-randomized random no. generator. i.e. everytime it starts, it generates the same sequence of random numbers. The "counter" mode generates incrementing integers starting from 1. The "random" mode uses the "second" part of the system timer to initialize the random number generator. The "very_random" mode uses the "micro-second" part of the system timer to initialize the random number generator. acknowledgement: Specify the acknowledgement timeout value. A missing "acknowledgement" or a value of 0 means no acknowledgement. An integer value N means the message sender will wait for N seconds before it times out. 2 Shutdown the Transport Layer tp_halt_transport Stop the Transport layer. Utility Predicates ------------------ 1. Generate a Conversational-ID tp_generate_id(-Id) Generate an integer which can be used as an ID. The generator mode is determined by the "id" parameter when calling "tp_init_transport/1". Message Sending & Receiving --------------------------- 1. Send a Message tp_send_message(+Message) Send a composed message (by mf_compose_message/5 or /6 in the "message_format" module). 2. Receive a Message tp_receive_message(?Message_template) Receive a message matching the message-template. "Message_template" is a message composed by composed_message/5 or /6 specifying the receiving criteria. This API blocks until a matching message is received. tp_receive_message(My_name,-Message) Given the agent's name, receive a message targetted to it. This is a preferred API over "receive_message/1". This API blocks until a matching message is received. Instead of customising the receive-template, an agent should accept all messages sent to it and handle them appropriately. Selective receiving is not supported by all communication mechanism and is discouraged. 3. Receive a Message without blocking tp_receive_message_noblock(?Message_template) Receive a message matching the message-template without blocking. "Message_template" is a message composed by composed_message/5 or /6 specifiying the matching template. tp_receive_message_noblock(My_name,-Message) Similary to "receive_message/2" but without blocking.