@@ -506,12 +506,12 @@ int_fast8_t udpardTxInit(struct UdpardTx* const self,
506506/// The MTU of the generated datagrams is dependent on the value of the MTU setting at the time when this function
507507/// is invoked. The MTU setting can be changed arbitrarily between invocations.
508508///
509- /// The pointer to the transfer_id will be used to populate the transfer_id field of the generated datagrams and
510- /// then to increment the pointed-to value to prepare it for the next publication.
509+ /// The transfer_id parameter will be used to populate the transfer_id field of the generated datagrams.
510+ /// The caller shall increment the transfer-ID counter after each successful invocation of this function
511+ /// per redundant interface; the same transfer published over redundant interfaces shall have the same transfer-ID.
511512/// There shall be a separate transfer-ID counter per subject (topic).
512- /// The lifetime of the pointed-to transfer-ID counter must exceed the lifetime of the intent to publish on this
513- /// subject (topic); one common approach is to use a static variable.
514- /// The transfer-ID counter is not modified if the function fails.
513+ /// The lifetime of the transfer-ID counter must exceed the lifetime of the intent to publish on this subject (topic);
514+ /// one common approach is to use a static variable or a field in a type that contains the state of the publisher.
515515///
516516/// The user_transfer_reference is an opaque pointer that will be assigned to the user_transfer_reference field of
517517/// each enqueued item. The library itself does not use or check this value in any way, so it can be NULL if not needed.
@@ -558,19 +558,21 @@ int32_t udpardTxPublish(struct UdpardTx* const self,
558558 const UdpardMicrosecond deadline_usec ,
559559 const enum UdpardPriority priority ,
560560 const UdpardPortID subject_id ,
561- UdpardTransferID * const transfer_id ,
561+ const UdpardTransferID transfer_id ,
562562 const struct UdpardPayload payload ,
563563 void * const user_transfer_reference );
564564
565565/// This is similar to udpardTxPublish except that it is intended for service request transfers.
566566/// It takes the node-ID of the server that is intended to receive the request.
567567///
568- /// The pointer to the transfer_id will be used to populate the transfer_id field of the generated datagrams and
569- /// then to increment the pointed-to value to prepare it for the next request.
568+ /// The transfer_id parameter will be used to populate the transfer_id field of the generated datagrams.
569+ /// The caller shall increment the transfer-ID counter after each successful invocation of this function
570+ /// per redundant interface; the same transfer published over redundant interfaces shall have the same transfer-ID.
570571/// There shall be a separate transfer-ID counter per pair of (service-ID, server node-ID).
571- /// The lifetime of the pointed-to transfer-ID counter must exceed the lifetime of the intent to invoke this service
572- /// on this server node; one common approach is to use a static array indexed by the server node-ID per service-ID
573- /// (memory-constrained applications may choose a more compact container).
572+ /// The lifetime of the transfer-ID counter must exceed the lifetime of the intent to invoke this service
573+ /// on this server node; one common approach is to use a static array or a struct field indexed by
574+ /// the server node-ID per service-ID (memory-constrained applications may choose a more compact container;
575+ /// e.g., a list or an AVL tree).
574576///
575577/// Additional error conditions:
576578/// - UDPARD_ERROR_ARGUMENT if the server node-ID value is invalid.
@@ -582,14 +584,13 @@ int32_t udpardTxRequest(struct UdpardTx* const self,
582584 const enum UdpardPriority priority ,
583585 const UdpardPortID service_id ,
584586 const UdpardNodeID server_node_id ,
585- UdpardTransferID * const transfer_id ,
587+ const UdpardTransferID transfer_id ,
586588 const struct UdpardPayload payload ,
587589 void * const user_transfer_reference );
588590
589- /// This is similar to udpardTxRequest except that it takes the node-ID of the client instead of server,
590- /// and the transfer-ID is passed by value rather than by pointer.
591- /// The transfer-ID is passed by value because when responding to an RPC-service request, the server must
592- /// reuse the transfer-ID value of the request (this is to allow the client to match responses with their requests).
591+ /// This is similar to udpardTxRequest except that it takes the node-ID of the client instead of server.
592+ /// The transfer-ID must be the same as that of the corresponding RPC-request transfer;
593+ /// this is to allow the client to match responses with their requests.
593594int32_t udpardTxRespond (struct UdpardTx * const self ,
594595 const UdpardMicrosecond deadline_usec ,
595596 const enum UdpardPriority priority ,
0 commit comments