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