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__)
55typedef unsigned __int64 pn_socket_t;
57typedef unsigned int pn_socket_t;
59#define PN_INVALID_SOCKET (pn_socket_t)(~0)
61typedef int pn_socket_t;
62#define PN_INVALID_SOCKET (-1)
83typedef struct pn_selectable_t pn_selectable_t;
85PNX_EXTERN pn_selectable_t *pn_selectable(
void);
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 *));
94PNX_EXTERN
pn_record_t *pn_selectable_attachments(pn_selectable_t *sel);
102PNX_EXTERN pn_socket_t pn_selectable_get_fd(pn_selectable_t *selectable);
110PNX_EXTERN
void pn_selectable_set_fd(pn_selectable_t *selectable, pn_socket_t fd);
118PNX_EXTERN
bool pn_selectable_is_reading(pn_selectable_t *selectable);
120PNX_EXTERN
void pn_selectable_set_reading(pn_selectable_t *sel,
bool reading);
128PNX_EXTERN
bool pn_selectable_is_writing(pn_selectable_t *selectable);
130 PNX_EXTERN
void pn_selectable_set_writing(pn_selectable_t *sel,
bool writing);
142PNX_EXTERN
pn_timestamp_t pn_selectable_get_deadline(pn_selectable_t *selectable);
144PNX_EXTERN
void pn_selectable_set_deadline(pn_selectable_t *sel,
pn_timestamp_t deadline);
151PNX_EXTERN
void pn_selectable_readable(pn_selectable_t *selectable);
158PNX_EXTERN
void pn_selectable_writable(pn_selectable_t *selectable);
165PNX_EXTERN
void pn_selectable_error(pn_selectable_t *selectable);
172PNX_EXTERN
void pn_selectable_expired(pn_selectable_t *selectable);
184PNX_EXTERN
bool pn_selectable_is_registered(pn_selectable_t *selectable);
194PNX_EXTERN
void pn_selectable_set_registered(pn_selectable_t *selectable,
bool registered);
208PNX_EXTERN
bool pn_selectable_is_terminal(pn_selectable_t *selectable);
215PNX_EXTERN
void pn_selectable_terminate(pn_selectable_t *selectable);
217PNX_EXTERN
void pn_selectable_release(pn_selectable_t *selectable);
224PNX_EXTERN
void pn_selectable_free(pn_selectable_t *selectable);
233PNX_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