Qpid Proton C API 0.39.0
 
Loading...
Searching...
No Matches
selectable.h
1#ifndef PROTON_SELECTABLE_H
2#define PROTON_SELECTABLE_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/event.h>
27#include <proton/type_compat.h>
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
53#if defined(_WIN32) && ! defined(__CYGWIN__)
54#ifdef _WIN64
55typedef unsigned __int64 pn_socket_t;
56#else
57typedef unsigned int pn_socket_t;
58#endif
59#define PN_INVALID_SOCKET (pn_socket_t)(~0)
60#else
61typedef int pn_socket_t;
62#define PN_INVALID_SOCKET (-1)
63#endif
64
83typedef struct pn_selectable_t pn_selectable_t;
84
85PNX_EXTERN pn_selectable_t *pn_selectable(void);
86
87PNX_EXTERN void pn_selectable_on_readable(pn_selectable_t *sel, void (*readable)(pn_selectable_t *));
88PNX_EXTERN void pn_selectable_on_writable(pn_selectable_t *sel, void (*writable)(pn_selectable_t *));
89PNX_EXTERN void pn_selectable_on_expired(pn_selectable_t *sel, void (*expired)(pn_selectable_t *));
90PNX_EXTERN void pn_selectable_on_error(pn_selectable_t *sel, void (*error)(pn_selectable_t *));
91PNX_EXTERN void pn_selectable_on_release(pn_selectable_t *sel, void (*release)(pn_selectable_t *));
92PNX_EXTERN void pn_selectable_on_finalize(pn_selectable_t *sel, void (*finalize)(pn_selectable_t *));
93
94PNX_EXTERN pn_record_t *pn_selectable_attachments(pn_selectable_t *sel);
95
102PNX_EXTERN pn_socket_t pn_selectable_get_fd(pn_selectable_t *selectable);
103
110PNX_EXTERN void pn_selectable_set_fd(pn_selectable_t *selectable, pn_socket_t fd);
111
118PNX_EXTERN bool pn_selectable_is_reading(pn_selectable_t *selectable);
119
120PNX_EXTERN void pn_selectable_set_reading(pn_selectable_t *sel, bool reading);
121
128PNX_EXTERN bool pn_selectable_is_writing(pn_selectable_t *selectable);
129
130 PNX_EXTERN void pn_selectable_set_writing(pn_selectable_t *sel, bool writing);
131
142PNX_EXTERN pn_timestamp_t pn_selectable_get_deadline(pn_selectable_t *selectable);
143
144PNX_EXTERN void pn_selectable_set_deadline(pn_selectable_t *sel, pn_timestamp_t deadline);
145
151PNX_EXTERN void pn_selectable_readable(pn_selectable_t *selectable);
152
158PNX_EXTERN void pn_selectable_writable(pn_selectable_t *selectable);
159
165PNX_EXTERN void pn_selectable_error(pn_selectable_t *selectable);
166
172PNX_EXTERN void pn_selectable_expired(pn_selectable_t *selectable);
173
184PNX_EXTERN bool pn_selectable_is_registered(pn_selectable_t *selectable);
185
194PNX_EXTERN void pn_selectable_set_registered(pn_selectable_t *selectable, bool registered);
195
208PNX_EXTERN bool pn_selectable_is_terminal(pn_selectable_t *selectable);
209
215PNX_EXTERN void pn_selectable_terminate(pn_selectable_t *selectable);
216
217PNX_EXTERN void pn_selectable_release(pn_selectable_t *selectable);
218
224PNX_EXTERN void pn_selectable_free(pn_selectable_t *selectable);
225
233PNX_EXTERN void pn_selectable_collect(pn_selectable_t *selectable, pn_collector_t *collector);
234
239#ifdef __cplusplus
240}
241#endif
242
243#endif /* selectable.h */
Protocol and transport events.
int64_t pn_timestamp_t
A 64-bit timestamp in milliseconds since the Unix epoch.
Definition: types.h:170
struct pn_collector_t pn_collector_t
An event collector.
Definition: types.h:417
struct pn_record_t pn_record_t
A type representing attached context information.
Definition: types.h:477