+/** \ingroup msg_gos_functions \brief Put a task on a channel of an
+ * host (with a timeout on the waiting of the destination host) and
+ * waits for the end of the transmission.
+ *
+ * This function is used for describing the behavior of an agent. It
+ * takes four parameter.
+ * \param task a #m_task_t to send on another location. This task
+ will not be usable anymore when the function will return. There is
+ no automatic task duplication and you have to save your parameters
+ before calling this function. Tasks are unique and once it has been
+ sent to another location, you should not access it anymore. You do
+ not need to call MSG_task_destroy() but to avoid using, as an
+ effect of inattention, this task anymore, you definitely should
+ renitialize it with #MSG_TASK_UNINITIALIZED. Note that this task
+ can be transfered iff it has been correctly created with
+ MSG_task_create().
+ * \param dest the destination of the message
+ * \param channel the channel on which the agent should put this
+ task. This value has to be >=0 and < than the maximal number of
+ channels fixed with MSG_set_channel_number().
+ * \param timeout the maximum time to wait for a task before giving
+ up. In such a case, #MSG_TRANSFER_FAILURE will be returned, \a task
+ will not be modified
+ * \return #MSG_FATAL if \a task is not properly initialized and
+#MSG_OK otherwise. Returns #MSG_HOST_FAILURE if the host on which
+this function was called was shut down. Returns
+#MSG_TRANSFER_FAILURE if the transfer could not be properly done
+(network failure, dest failure, timeout...)
+ */
+MSG_error_t
+MSG_task_put_with_timeout(m_task_t task, m_host_t dest,
+ m_channel_t channel, double timeout)
+{
+ xbt_assert1((channel >= 0)
+ && (channel < msg_global->max_channel), "Invalid channel %d",
+ channel);
+
+ DEBUG1("MSG_task_put_with_timout: Trying to send a task to '%s'", dest->name);
+ return
+ MSG_mailbox_put_with_timeout(MSG_mailbox_get_by_channel
+ (dest, channel), task, timeout);
+}