proton  0
link.h
Go to the documentation of this file.
1 #ifndef PROTON_LINK_H
2 #define PROTON_LINK_H 1
3 
4 /*
5  *
6  * Licensed to the Apache Software Foundation (ASF) under one
7  * or more contributor license agreements. See the NOTICE file
8  * distributed with this work for additional information
9  * regarding copyright ownership. The ASF licenses this file
10  * to you under the Apache License, Version 2.0 (the
11  * "License"); you may not use this file except in compliance
12  * with the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing,
17  * software distributed under the License is distributed on an
18  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19  * KIND, either express or implied. See the License for the
20  * specific language governing permissions and limitations
21  * under the License.
22  *
23  */
24 
25 #include <proton/import_export.h>
26 #include <proton/type_compat.h>
27 #include <proton/condition.h>
28 #include <proton/terminus.h>
29 #include <proton/types.h>
30 #include <proton/object.h>
31 #include <stddef.h>
32 #include <sys/types.h>
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 /**
39  * @file
40  *
41  * Link API for the proton Engine.
42  *
43  * @defgroup link Link
44  * @ingroup engine
45  * @{
46  */
47 
48 /**
49  * Construct a new sender on a session.
50  *
51  * Each sending link between two AMQP containers must be uniquely
52  * named. Note that this uniqueness cannot be enforced at the API
53  * level, so some consideration should be taken in choosing link
54  * names.
55  *
56  * @param[in] session the session object
57  * @param[in] name the name of the link
58  * @return a newly constructed sender link or NULL on error
59  */
60 PN_EXTERN pn_link_t *pn_sender(pn_session_t *session, const char *name);
61 
62 /**
63  * Construct a new receiver on a session.
64  *
65  * Each receiving link between two AMQP containers must be uniquely
66  * named. Note that this uniqueness cannot be enforced at the API
67  * level, so some consideration should be taken in choosing link
68  * names.
69  *
70  * @param[in] session the session object
71  * @param[in] name the name of the link
72  * @return a newly constructed receiver link or NULL on error
73  */
74 PN_EXTERN pn_link_t *pn_receiver(pn_session_t *session, const char *name);
75 
76 /**
77  * Free a link object.
78  *
79  * When a link object is freed, all ::pn_delivery_t objects associated
80  * with the session are also freed. Freeing a link will settle any
81  * unsettled deliveries on the link.
82  *
83  * @param[in] link a link object to free (or NULL)
84  */
85 PN_EXTERN void pn_link_free(pn_link_t *link);
86 
87 /**
88  * @deprecated
89  * Get the application context that is associated with a link object.
90  *
91  * The application context for a link may be set using
92  * ::pn_link_set_context.
93  *
94  * @param[in] link the link whose context is to be returned.
95  * @return the application context for the link object
96  */
98 
99 /**
100  * @deprecated
101  * Set a new application context for a link object.
102  *
103  * The application context for a link object may be retrieved using
104  * ::pn_link_get_context.
105  *
106  * @param[in] link the link object
107  * @param[in] context the application context
108  */
109 PN_EXTERN void pn_link_set_context(pn_link_t *link, void *context);
110 
111 /**
112  * Get the attachments that are associated with a link object.
113  *
114  * @param[in] link the link whose attachments are to be returned.
115  * @return the attachments for the link object
116  */
118 
119 /**
120  * Get the name of a link.
121  *
122  * @param[in] link a link object
123  * @return the name of the link
124  */
125 PN_EXTERN const char *pn_link_name(pn_link_t *link);
126 
127 /**
128  * Test if a link is a sender.
129  *
130  * @param[in] link a link object
131  * @return true if and only if the link is a sender
132  */
134 
135 /**
136  * Test if a link is a receiver.
137  *
138  * @param[in] link a link object
139  * @return true if and only if the link is a receiver
140  */
142 
143 /**
144  * Get the endpoint state flags for a link.
145  *
146  * @param[in] link the link
147  * @return the link's state flags
148  */
150 
151 /**
152  * Get additional error information associated with the link.
153  *
154  * Whenever a link operation fails (i.e. returns an error code),
155  * additional error details can be obtained using this function. The
156  * error object that is returned may also be used to clear the error
157  * condition.
158  *
159  * The pointer returned by this operation is valid until the
160  * link object is freed.
161  *
162  * @param[in] link the link object
163  * @return the link's error object
164  */
166 
167 /**
168  * Get the local condition associated with a link endpoint.
169  *
170  * The ::pn_condition_t object retrieved may be modified prior to
171  * closing a link in order to indicate a particular condition
172  * exists when the link closes. This is normally used to
173  * communicate error conditions to the remote peer, however it may
174  * also be used in non error cases. See ::pn_condition_t for more
175  * details.
176  *
177  * The pointer returned by this operation is valid until the link
178  * object is freed.
179  *
180  * @param[in] link the link object
181  * @return the link's local condition object
182  */
184 
185 /**
186  * Get the remote condition associated with a link endpoint.
187  *
188  * The ::pn_condition_t object retrieved may be examined in order to
189  * determine whether the remote peer was indicating some sort of
190  * exceptional condition when the remote link endpoint was
191  * closed. The ::pn_condition_t object returned may not be modified.
192  *
193  * The pointer returned by this operation is valid until the
194  * link object is freed.
195  *
196  * @param[in] link the link object
197  * @return the link's remote condition object
198  */
200 
201 /**
202  * Get the parent session for a link object.
203  *
204  * This operation retrieves the parent ::pn_session_t object that
205  * contains the given ::pn_link_t object.
206  *
207  * @param[in] link the link object
208  * @return the parent session object
209  */
211 
212 /**
213  * Retrieve the first link that matches the given state mask.
214  *
215  * Examines the state of each link owned by the connection and returns
216  * the first link that matches the given state mask. If state contains
217  * both local and remote flags, then an exact match against those
218  * flags is performed. If state contains only local or only remote
219  * flags, then a match occurs if any of the local or remote flags are
220  * set respectively.
221  *
222  * @param[in] connection to be searched for matching Links
223  * @param[in] state mask to match
224  * @return the first link owned by the connection that matches the
225  * mask, else NULL if no links match
226  */
228 
229 /**
230  * Retrieve the next link that matches the given state mask.
231  *
232  * When used with pn_link_head, the application can access all links
233  * on the connection that match the given state. See pn_link_head for
234  * description of match behavior.
235  *
236  * @param[in] link the previous link obtained from pn_link_head or
237  * pn_link_next
238  * @param[in] state mask to match
239  * @return the next session owned by the connection that matches the
240  * mask, else NULL if no sessions match
241  */
243 
244 /**
245  * Open a link.
246  *
247  * Once this operation has completed, the PN_LOCAL_ACTIVE state flag
248  * will be set.
249  *
250  * @param[in] link a link object
251  */
252 PN_EXTERN void pn_link_open(pn_link_t *link);
253 
254 /**
255  * Close a link.
256  *
257  * Once this operation has completed, the PN_LOCAL_CLOSED state flag
258  * will be set. This may be called without calling
259  * ::pn_link_open, in this case it is equivalent to calling
260  * ::pn_link_open followed by ::pn_link_close.
261  *
262  * @param[in] link a link object
263  */
264 PN_EXTERN void pn_link_close(pn_link_t *link);
265 
266 /**
267  * Detach a link.
268  *
269  * @param[in] link a link object
270  */
272 
273 /**
274  * Access the locally defined source definition for a link.
275  *
276  * The pointer returned by this operation is valid until the link
277  * object is freed.
278  *
279  * @param[in] link a link object
280  * @return a pointer to a source terminus
281  */
283 
284 /**
285  * Access the locally defined target definition for a link.
286  *
287  * The pointer returned by this operation is valid until the link
288  * object is freed.
289  *
290  * @param[in] link a link object
291  * @return a pointer to a target terminus
292  */
294 
295 /**
296  * Access the remotely defined source definition for a link.
297  *
298  * The pointer returned by this operation is valid until the link
299  * object is freed. The remotely defined terminus will be empty until
300  * the link is remotely opened as indicated by the PN_REMOTE_ACTIVE
301  * flag.
302  *
303  * @param[in] link a link object
304  * @return a pointer to the remotely defined source terminus
305  */
307 
308 /**
309  * Access the remotely defined target definition for a link.
310  *
311  * The pointer returned by this operation is valid until the link
312  * object is freed. The remotely defined terminus will be empty until
313  * the link is remotely opened as indicated by the PN_REMOTE_ACTIVE
314  * flag.
315  *
316  * @param[in] link a link object
317  * @return a pointer to the remotely defined target terminus
318  */
320 
321 /**
322  * Get the current delivery for a link.
323  *
324  * Each link maintains a sequence of deliveries in the order they were
325  * created, along with a pointer to the *current* delivery. All
326  * send/recv operations on a link take place on the *current*
327  * delivery. If a link has no current delivery, the current delivery
328  * is automatically initialized to the next delivery created on the
329  * link. Once initialized, the current delivery remains the same until
330  * it is changed through use of ::pn_link_advance or until it is
331  * settled via ::pn_delivery_settle.
332  *
333  * @param[in] link a link object
334  * @return the current delivery for the link, or NULL if there is none
335  */
337 
338 /**
339  * Advance the current delivery of a link to the next delivery on the
340  * link.
341  *
342  * For sending links this operation is used to finish sending message
343  * data for the current outgoing delivery and move on to the next
344  * outgoing delivery (if any).
345  *
346  * For receiving links, this operation is used to finish accessing
347  * message data from the current incoming delivery and move on to the
348  * next incoming delivery (if any).
349  *
350  * Each link maintains a sequence of deliveries in the order they were
351  * created, along with a pointer to the *current* delivery. The
352  * pn_link_advance operation will modify the *current* delivery on the
353  * link to point to the next delivery in the sequence. If there is no
354  * next delivery in the sequence, the current delivery will be set to
355  * NULL. This operation will return true if invoking it caused the
356  * value of the current delivery to change, even if it was set to
357  * NULL.
358  *
359  * @param[in] link a link object
360  * @return true if the current delivery was changed
361  */
363 
364 /**
365  * Get the credit balance for a link.
366  *
367  * Links use a credit based flow control scheme. Every receiver
368  * maintains a credit balance that corresponds to the number of
369  * deliveries that the receiver can accept at any given moment. As
370  * more capacity becomes available at the receiver (see
371  * ::pn_link_flow), it adds credit to this balance and communicates
372  * the new balance to the sender. Whenever a delivery is
373  * sent/received, the credit balance maintained by the link is
374  * decremented by one. Once the credit balance at the sender reaches
375  * zero, the sender must pause sending until more credit is obtained
376  * from the receiver.
377  *
378  * Note that a sending link may still be used to send deliveries even
379  * if pn_link_credit reaches zero, however those deliveries will end
380  * up being buffered by the link until enough credit is obtained from
381  * the receiver to send them over the wire. In this case the balance
382  * reported by ::pn_link_credit will go negative.
383  *
384  * @param[in] link a link object
385  * @return the credit balance for the link
386  */
388 
389 /**
390  * Get the number of queued deliveries for a link.
391  *
392  * Links may queue deliveries for a number of reasons, for example
393  * there may be insufficient credit to send them to the receiver (see
394  * ::pn_link_credit), or they simply may not have yet had a chance to
395  * be written to the wire. This operation will return the number of
396  * queued deliveries on a link.
397  *
398  * @param[in] link a link object
399  * @return the number of queued deliveries for the link
400  */
402 
403 /**
404  * Get the remote view of the credit for a link.
405  *
406  * The remote view of the credit for a link differs from local view of
407  * credit for a link by the number of queued deliveries. In other
408  * words ::pn_link_remote_credit is defined to be ::pn_link_credit -
409  * ::pn_link_queued.
410  *
411  * @param[in] link a link object
412  * @return the remote view of the credit for a link
413  */
415 
416 /**
417  * Get the drain flag for a link.
418  *
419  * If a link is in drain mode, then the sending endpoint of a link
420  * must immediately use up all available credit on the link. If this
421  * is not possible, the excess credit must be returned by invoking
422  * ::pn_link_drained. Only the receiving endpoint can set the drain
423  * mode. See ::pn_link_set_drain for details.
424  *
425  * @param[in] link a link object
426  * @return true if and only if the link is in drain mode
427  */
429 
430 /**
431  * Drain excess credit for a link.
432  *
433  * When a link is in drain mode, the sender must use all excess credit
434  * immediately, and release any excess credit back to the receiver if
435  * there are no deliveries available to send.
436  *
437  * When invoked on a sending link that is in drain mode, this
438  * operation will release all excess credit back to the receiver and
439  * return the number of credits released back to the sender. If the
440  * link is not in drain mode, this operation is a noop.
441  *
442  * When invoked on a receiving link, this operation will return and
443  * reset the number of credits the sender has released back to the
444  * receiver.
445  *
446  * @param[in] link a link object
447  * @return the number of credits drained
448  */
450 
451 /**
452  * Get the available deliveries hint for a link.
453  *
454  * The available count for a link provides a hint as to the number of
455  * deliveries that might be able to be sent if sufficient credit were
456  * issued by the receiving link endpoint. See ::pn_link_offered for
457  * more details.
458  *
459  * @param[in] link a link object
460  * @return the available deliveries hint
461  */
463 
464 /**
465  * Describes the permitted/expected settlement behaviours of a sending
466  * link.
467  *
468  * The sender settle mode describes the permitted and expected
469  * behaviour of a sending link with respect to settling of deliveries.
470  * See ::pn_delivery_settle for more details.
471  */
472 typedef enum {
473  PN_SND_UNSETTLED = 0, /**< The sender will send all deliveries
474  initially unsettled. */
475  PN_SND_SETTLED = 1, /**< The sender will send all deliveries settled
476  to the receiver. */
477  PN_SND_MIXED = 2 /**< The sender may send a mixure of settled and
478  unsettled deliveries. */
480 
481 /**
482  * Describes the permitted/expected settlement behaviours of a
483  * receiving link.
484  *
485  * The receiver settle mode describes the permitted and expected
486  * behaviour of a receiving link with respect to settling of
487  * deliveries. See ::pn_delivery_settle for more details.
488  */
489 typedef enum {
490  PN_RCV_FIRST = 0, /**< The receiver will settle deliveries
491  regardless of what the sender does. */
492  PN_RCV_SECOND = 1 /**< The receiver will only settle deliveries
493  after the sender settles. */
495 
496 /**
497  * Get the local sender settle mode for a link.
498  *
499  * @param[in] link a link object
500  * @return the local sender settle mode
501  */
503 
504 /**
505  * Get the local receiver settle mode for a link.
506  *
507  * @param[in] link a link object
508  * @return the local receiver settle mode
509  */
511 
512 /**
513  * Set the local sender settle mode for a link.
514  *
515  * @param[in] link a link object
516  * @param[in] mode the sender settle mode
517  */
519 
520 /**
521  * Set the local receiver settle mode for a link.
522  *
523  * @param[in] link a link object
524  * @param[in] mode the receiver settle mode
525  */
527 
528 /**
529  * Get the remote sender settle mode for a link.
530  *
531  * @param[in] link a link object
532  * @return the remote sender settle mode
533  */
535 
536 /**
537  * Get the remote receiver settle mode for a link.
538  *
539  * @param[in] link a link object
540  * @return the remote receiver settle mode
541  */
543 
544 /**
545  * Get the number of unsettled deliveries for a link.
546  *
547  * @param[in] link a link object
548  * @return the number of unsettled deliveries
549  */
551 
552 /**
553  * Get the first unsettled delivery for a link.
554  *
555  " @param[in] link a link object
556  * @return a pointer to the first unsettled delivery on the link
557  */
559 
560 /**
561  * Get the next unsettled delivery on a link.
562  *
563  * @param[in] delivery a delivery object
564  * @return the next unsettled delivery on the link
565  */
567 
568 /**
569  * @defgroup sender Sender
570  * @{
571  */
572 
573 /**
574  * Signal the availability of deliveries for a link.
575  *
576  * @param[in] sender a sender link object
577  * @param[in] credit the number of deliveries potentially available
578  * for transfer
579  */
580 PN_EXTERN void pn_link_offered(pn_link_t *sender, int credit);
581 
582 /**
583  * Send message data for the current delivery on a link.
584  *
585  * @param[in] sender a sender link object
586  * @param[in] bytes the start of the message data
587  * @param[in] n the number of bytes of message data
588  * @return the number of bytes sent, or an error code
589  */
590 PN_EXTERN ssize_t pn_link_send(pn_link_t *sender, const char *bytes, size_t n);
591 
592 //PN_EXTERN void pn_link_abort(pn_sender_t *sender);
593 
594 /** @} */
595 
596 // receiver
597 /**
598  * @defgroup receiver Receiver
599  * @{
600  */
601 
602 /**
603  * Grant credit for incoming deliveries on a receiver.
604  *
605  * @param[in] receiver a receiving link object
606  * @param[in] credit the amount to increment the link credit
607  */
608 PN_EXTERN void pn_link_flow(pn_link_t *receiver, int credit);
609 
610 /**
611  * Grant credit for incoming deliveries on a receiver, and set drain
612  * mode to true.
613  *
614  * Use ::pn_link_set_drain to set the drain mode explicitly.
615  *
616  * @param[in] receiver a receiving link object
617  * @param[in] credit the amount to increment the link credit
618  */
619 PN_EXTERN void pn_link_drain(pn_link_t *receiver, int credit);
620 
621 /**
622  * Set the drain mode on a link.
623  *
624  * @param[in] receiver a receiving link object
625  * @param[in] drain the drain mode
626  */
627 PN_EXTERN void pn_link_set_drain(pn_link_t *receiver, bool drain);
628 
629 /**
630  * Receive message data for the current delivery on a link.
631  *
632  * Use ::pn_delivery_pending on the current delivery to figure out how
633  * much buffer space is needed.
634  *
635  * Note that the link API can be used to stream large messages across
636  * the network, so just because there is no data to read does not
637  * imply the message is complete. To ensure the entirety of the
638  * message data has been read, either invoke ::pn_link_recv until
639  * PN_EOS is returned, or verify that ::pn_delivery_partial is false,
640  * and ::pn_delivery_pending is 0.
641  *
642  * @param[in] receiver a receiving link object
643  * @param[in] bytes a pointer to an empty buffer
644  * @param[in] n the buffer capacity
645  * @return the number of bytes received, PN_EOS, or an error code
646  */
647 PN_EXTERN ssize_t pn_link_recv(pn_link_t *receiver, char *bytes, size_t n);
648 
649 /**
650  * Check if a link is currently draining.
651  *
652  * A link is defined to be draining when drain mode is set to true,
653  * and the sender still has excess credit.
654  *
655  * @param[in] receiver a receiving link object
656  * @return true if the link is currently draining, false otherwise
657  */
658 PN_EXTERN bool pn_link_draining(pn_link_t *receiver);
659 
660 /** @} */
661 
662 /** @}
663  */
664 
665 #ifdef __cplusplus
666 }
667 #endif
668 
669 #endif /* link.h */
670 
PN_EXTERN void pn_link_flow(pn_link_t *receiver, int credit)
Grant credit for incoming deliveries on a receiver.
The Condition API for the proton Engine.
struct pn_error_t pn_error_t
Definition: error.h:32
PN_EXTERN pn_condition_t * pn_link_condition(pn_link_t *link)
Get the local condition associated with a link endpoint.
PN_EXTERN pn_terminus_t * pn_link_source(pn_link_t *link)
Access the locally defined source definition for a link.
struct pn_record_t pn_record_t
Definition: object.h:46
struct pn_connection_t pn_connection_t
An AMQP Connection object.
Definition: types.h:112
PN_EXTERN bool pn_link_is_receiver(pn_link_t *link)
Test if a link is a receiver.
The sender may send a mixure of settled and unsettled deliveries.
Definition: link.h:477
PN_EXTERN int pn_link_remote_credit(pn_link_t *link)
Get the remote view of the credit for a link.
PN_EXTERN pn_delivery_t * pn_link_current(pn_link_t *link)
Get the current delivery for a link.
PN_EXTERN int pn_link_available(pn_link_t *link)
Get the available deliveries hint for a link.
PN_EXTERN pn_rcv_settle_mode_t pn_link_remote_rcv_settle_mode(pn_link_t *link)
Get the remote receiver settle mode for a link.
struct pn_delivery_t pn_delivery_t
An AMQP Delivery object.
Definition: types.h:232
PN_EXTERN pn_session_t * pn_link_session(pn_link_t *link)
Get the parent session for a link object.
The receiver will only settle deliveries after the sender settles.
Definition: link.h:492
PN_EXTERN pn_record_t * pn_link_attachments(pn_link_t *link)
Get the attachments that are associated with a link object.
PN_EXTERN pn_link_t * pn_sender(pn_session_t *session, const char *name)
Construct a new sender on a session.
struct pn_link_t pn_link_t
An AMQP Link object.
Definition: types.h:142
PN_EXTERN void pn_link_open(pn_link_t *link)
Open a link.
PN_EXTERN pn_terminus_t * pn_link_remote_target(pn_link_t *link)
Access the remotely defined target definition for a link.
PN_EXTERN bool pn_link_is_sender(pn_link_t *link)
Test if a link is a sender.
#define PN_EXTERN
Definition: import_export.h:53
PN_EXTERN void pn_link_detach(pn_link_t *link)
Detach a link.
PN_EXTERN pn_snd_settle_mode_t pn_link_snd_settle_mode(pn_link_t *link)
Get the local sender settle mode for a link.
PN_EXTERN void * pn_link_get_context(pn_link_t *link)
pn_snd_settle_mode_t
Describes the permitted/expected settlement behaviours of a sending link.
Definition: link.h:472
PN_EXTERN bool pn_link_get_drain(pn_link_t *link)
Get the drain flag for a link.
PN_EXTERN pn_delivery_t * pn_unsettled_head(pn_link_t *link)
Get the first unsettled delivery for a link.
Terminus API for the proton Engine.
PN_EXTERN int pn_link_queued(pn_link_t *link)
Get the number of queued deliveries for a link.
PN_EXTERN void pn_link_set_drain(pn_link_t *receiver, bool drain)
Set the drain mode on a link.
PN_EXTERN pn_state_t pn_link_state(pn_link_t *link)
Get the endpoint state flags for a link.
The receiver will settle deliveries regardless of what the sender does.
Definition: link.h:490
PN_EXTERN pn_snd_settle_mode_t pn_link_remote_snd_settle_mode(pn_link_t *link)
Get the remote sender settle mode for a link.
PN_EXTERN pn_link_t * pn_link_head(pn_connection_t *connection, pn_state_t state)
Retrieve the first link that matches the given state mask.
PN_EXTERN pn_rcv_settle_mode_t pn_link_rcv_settle_mode(pn_link_t *link)
Get the local receiver settle mode for a link.
PN_EXTERN bool pn_link_draining(pn_link_t *receiver)
Check if a link is currently draining.
PN_EXTERN pn_link_t * pn_link_next(pn_link_t *link, pn_state_t state)
Retrieve the next link that matches the given state mask.
PN_EXTERN void pn_link_offered(pn_link_t *sender, int credit)
Signal the availability of deliveries for a link.
struct pn_terminus_t pn_terminus_t
Encapsulates the endpoint state associated with an AMQP Terminus.
Definition: terminus.h:54
PN_EXTERN pn_condition_t * pn_link_remote_condition(pn_link_t *link)
Get the remote condition associated with a link endpoint.
PN_EXTERN int pn_link_drained(pn_link_t *link)
Drain excess credit for a link.
PN_EXTERN int pn_link_credit(pn_link_t *link)
Get the credit balance for a link.
PN_EXTERN pn_error_t * pn_link_error(pn_link_t *link)
Get additional error information associated with the link.
PN_EXTERN pn_terminus_t * pn_link_remote_source(pn_link_t *link)
Access the remotely defined source definition for a link.
PN_EXTERN pn_delivery_t * pn_unsettled_next(pn_delivery_t *delivery)
Get the next unsettled delivery on a link.
PN_EXTERN void pn_link_set_rcv_settle_mode(pn_link_t *link, pn_rcv_settle_mode_t mode)
Set the local receiver settle mode for a link.
PN_EXTERN void pn_link_free(pn_link_t *link)
Free a link object.
The sender will send all deliveries initially unsettled.
Definition: link.h:473
PN_EXTERN void pn_link_drain(pn_link_t *receiver, int credit)
Grant credit for incoming deliveries on a receiver, and set drain mode to true.
PN_EXTERN bool pn_link_advance(pn_link_t *link)
Advance the current delivery of a link to the next delivery on the link.
PN_EXTERN void pn_link_set_snd_settle_mode(pn_link_t *link, pn_snd_settle_mode_t mode)
Set the local sender settle mode for a link.
PN_EXTERN void pn_link_set_context(pn_link_t *link, void *context)
PN_EXTERN pn_link_t * pn_receiver(pn_session_t *session, const char *name)
Construct a new receiver on a session.
The sender will send all deliveries settled to the receiver.
Definition: link.h:475
struct pn_session_t pn_session_t
An AMQP Session object.
Definition: types.h:123
PN_EXTERN int pn_link_unsettled(pn_link_t *link)
Get the number of unsettled deliveries for a link.
PN_EXTERN pn_terminus_t * pn_link_target(pn_link_t *link)
Access the locally defined target definition for a link.
PN_EXTERN const char * pn_link_name(pn_link_t *link)
Get the name of a link.
pn_rcv_settle_mode_t
Describes the permitted/expected settlement behaviours of a receiving link.
Definition: link.h:489
struct pn_condition_t pn_condition_t
An AMQP Condition object.
Definition: condition.h:65
PN_EXTERN ssize_t pn_link_send(pn_link_t *sender, const char *bytes, size_t n)
Send message data for the current delivery on a link.
int pn_state_t
Holds the state flags for an AMQP endpoint.
Definition: types.h:97
PN_EXTERN void pn_link_close(pn_link_t *link)
Close a link.
PN_EXTERN ssize_t pn_link_recv(pn_link_t *receiver, char *bytes, size_t n)
Receive message data for the current delivery on a link.