C AMQP Protocol Engine API  0.7
 All Classes 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 
56 PN_EXTERN pn_link_t *pn_sender(pn_session_t *session, const char *name);
57 
70 PN_EXTERN pn_link_t *pn_receiver(pn_session_t *session, const char *name);
71 
80 PN_EXTERN void pn_link_free(pn_link_t *link);
81 
92 
102 PN_EXTERN void pn_link_set_context(pn_link_t *link, void *context);
103 
110 PN_EXTERN const char *pn_link_name(pn_link_t *link);
111 
119 
127 
135 
151 
169 
185 
196 
213 
228 
237 PN_EXTERN void pn_link_open(pn_link_t *link);
238 
249 PN_EXTERN void pn_link_close(pn_link_t *link);
250 
261 
272 
285 
298 
315 
341 
366 
380 
393 
407 
428 
441 
450 typedef enum {
458 
467 typedef enum {
473 
481 
489 
497 
505 
513 
521 
529 
537 
545 
558 PN_EXTERN void pn_link_offered(pn_link_t *sender, int credit);
559 
568 PN_EXTERN ssize_t pn_link_send(pn_link_t *sender, const char *bytes, size_t n);
569 
570 //PN_EXTERN void pn_link_abort(pn_sender_t *sender);
571 
574 // receiver
586 PN_EXTERN void pn_link_flow(pn_link_t *receiver, int credit);
587 
597 PN_EXTERN void pn_link_drain(pn_link_t *receiver, int credit);
598 
605 PN_EXTERN void pn_link_set_drain(pn_link_t *receiver, bool drain);
606 
625 PN_EXTERN ssize_t pn_link_recv(pn_link_t *receiver, char *bytes, size_t n);
626 
636 PN_EXTERN bool pn_link_draining(pn_link_t *receiver);
637 
643 #ifdef __cplusplus
644 }
645 #endif
646 
647 #endif /* link.h */
648