1 #ifndef PROTON_SELECTABLE_H
2 #define PROTON_SELECTABLE_H 1
25 #include <proton/import_export.h>
26 #include <proton/object.h>
28 #include <proton/type_compat.h>
54 #if defined(_WIN32) && ! defined(__CYGWIN__)
56 typedef unsigned __int64 pn_socket_t;
58 typedef unsigned int pn_socket_t;
60 #define PN_INVALID_SOCKET (pn_socket_t)(~0)
62 typedef int pn_socket_t;
63 #define PN_INVALID_SOCKET (-1)
84 typedef struct pn_selectable_t pn_selectable_t;
86 PNX_EXTERN pn_selectable_t *pn_selectable(
void);
88 PNX_EXTERN
void pn_selectable_on_readable(pn_selectable_t *sel,
void (*readable)(pn_selectable_t *));
89 PNX_EXTERN
void pn_selectable_on_writable(pn_selectable_t *sel,
void (*writable)(pn_selectable_t *));
90 PNX_EXTERN
void pn_selectable_on_expired(pn_selectable_t *sel,
void (*expired)(pn_selectable_t *));
91 PNX_EXTERN
void pn_selectable_on_error(pn_selectable_t *sel,
void (*error)(pn_selectable_t *));
92 PNX_EXTERN
void pn_selectable_on_release(pn_selectable_t *sel,
void (*release)(pn_selectable_t *));
93 PNX_EXTERN
void pn_selectable_on_finalize(pn_selectable_t *sel,
void (*finalize)(pn_selectable_t *));
95 PNX_EXTERN pn_record_t *pn_selectable_attachments(pn_selectable_t *sel);
103 PNX_EXTERN pn_socket_t pn_selectable_get_fd(pn_selectable_t *selectable);
111 PNX_EXTERN
void pn_selectable_set_fd(pn_selectable_t *selectable, pn_socket_t fd);
119 PNX_EXTERN
bool pn_selectable_is_reading(pn_selectable_t *selectable);
121 PNX_EXTERN
void pn_selectable_set_reading(pn_selectable_t *sel,
bool reading);
129 PNX_EXTERN
bool pn_selectable_is_writing(pn_selectable_t *selectable);
131 PNX_EXTERN
void pn_selectable_set_writing(pn_selectable_t *sel,
bool writing);
143 PNX_EXTERN
pn_timestamp_t pn_selectable_get_deadline(pn_selectable_t *selectable);
145 PNX_EXTERN
void pn_selectable_set_deadline(pn_selectable_t *sel,
pn_timestamp_t deadline);
152 PNX_EXTERN
void pn_selectable_readable(pn_selectable_t *selectable);
159 PNX_EXTERN
void pn_selectable_writable(pn_selectable_t *selectable);
166 PNX_EXTERN
void pn_selectable_error(pn_selectable_t *selectable);
173 PNX_EXTERN
void pn_selectable_expired(pn_selectable_t *selectable);
185 PNX_EXTERN
bool pn_selectable_is_registered(pn_selectable_t *selectable);
195 PNX_EXTERN
void pn_selectable_set_registered(pn_selectable_t *selectable,
bool registered);
209 PNX_EXTERN
bool pn_selectable_is_terminal(pn_selectable_t *selectable);
216 PNX_EXTERN
void pn_selectable_terminate(pn_selectable_t *selectable);
218 PNX_EXTERN
void pn_selectable_release(pn_selectable_t *selectable);
225 PNX_EXTERN
void pn_selectable_free(pn_selectable_t *selectable);
234 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