1 #ifndef PROTON_SELECTABLE_H
2 #define PROTON_SELECTABLE_H 1
25 #include <proton/import_export.h>
27 #include <proton/type_compat.h>
53 #if defined(_WIN32) && ! defined(__CYGWIN__)
55 typedef unsigned __int64 pn_socket_t;
57 typedef unsigned int pn_socket_t;
59 #define PN_INVALID_SOCKET (pn_socket_t)(~0)
61 typedef int pn_socket_t;
62 #define PN_INVALID_SOCKET (-1)
83 typedef struct pn_selectable_t pn_selectable_t;
85 PNX_EXTERN pn_selectable_t *pn_selectable(
void);
87 PNX_EXTERN
void pn_selectable_on_readable(pn_selectable_t *sel,
void (*readable)(pn_selectable_t *));
88 PNX_EXTERN
void pn_selectable_on_writable(pn_selectable_t *sel,
void (*writable)(pn_selectable_t *));
89 PNX_EXTERN
void pn_selectable_on_expired(pn_selectable_t *sel,
void (*expired)(pn_selectable_t *));
90 PNX_EXTERN
void pn_selectable_on_error(pn_selectable_t *sel,
void (*error)(pn_selectable_t *));
91 PNX_EXTERN
void pn_selectable_on_release(pn_selectable_t *sel,
void (*release)(pn_selectable_t *));
92 PNX_EXTERN
void pn_selectable_on_finalize(pn_selectable_t *sel,
void (*finalize)(pn_selectable_t *));
94 PNX_EXTERN
pn_record_t *pn_selectable_attachments(pn_selectable_t *sel);
102 PNX_EXTERN pn_socket_t pn_selectable_get_fd(pn_selectable_t *selectable);
110 PNX_EXTERN
void pn_selectable_set_fd(pn_selectable_t *selectable, pn_socket_t fd);
118 PNX_EXTERN
bool pn_selectable_is_reading(pn_selectable_t *selectable);
120 PNX_EXTERN
void pn_selectable_set_reading(pn_selectable_t *sel,
bool reading);
128 PNX_EXTERN
bool pn_selectable_is_writing(pn_selectable_t *selectable);
130 PNX_EXTERN
void pn_selectable_set_writing(pn_selectable_t *sel,
bool writing);
142 PNX_EXTERN
pn_timestamp_t pn_selectable_get_deadline(pn_selectable_t *selectable);
144 PNX_EXTERN
void pn_selectable_set_deadline(pn_selectable_t *sel,
pn_timestamp_t deadline);
151 PNX_EXTERN
void pn_selectable_readable(pn_selectable_t *selectable);
158 PNX_EXTERN
void pn_selectable_writable(pn_selectable_t *selectable);
165 PNX_EXTERN
void pn_selectable_error(pn_selectable_t *selectable);
172 PNX_EXTERN
void pn_selectable_expired(pn_selectable_t *selectable);
184 PNX_EXTERN
bool pn_selectable_is_registered(pn_selectable_t *selectable);
194 PNX_EXTERN
void pn_selectable_set_registered(pn_selectable_t *selectable,
bool registered);
208 PNX_EXTERN
bool pn_selectable_is_terminal(pn_selectable_t *selectable);
215 PNX_EXTERN
void pn_selectable_terminate(pn_selectable_t *selectable);
217 PNX_EXTERN
void pn_selectable_release(pn_selectable_t *selectable);
224 PNX_EXTERN
void pn_selectable_free(pn_selectable_t *selectable);
233 PNX_EXTERN
void pn_selectable_collect(pn_selectable_t *selectable,
pn_collector_t *collector);
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