1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 #ifndef ORTE_LISTENER_H
24 #define ORTE_LISTENER_H
25
26 #include "orte_config.h"
27
28 #ifdef HAVE_SYS_TYPES_H
29 #include <sys/types.h>
30 #endif
31 #ifdef HAVE_SYS_SOCKET_H
32 #include <sys/socket.h>
33 #endif
34
35 #include "opal/class/opal_list.h"
36 #include "opal/mca/event/event.h"
37
38
39 typedef void (*orte_listener_callback_fn_t)(int sd, short args, void *cbdata);
40
41
42
43
44 typedef struct orte_listener_t {
45 opal_list_item_t item;
46 int sd;
47 opal_event_base_t *evbase;
48 orte_listener_callback_fn_t handler;
49 } orte_listener_t;
50 OBJ_CLASS_DECLARATION(orte_listener_t);
51
52 typedef struct {
53 opal_object_t super;
54 opal_event_t ev;
55 int fd;
56 struct sockaddr_storage addr;
57 } orte_pending_connection_t;
58 OBJ_CLASS_DECLARATION(orte_pending_connection_t);
59
60 ORTE_DECLSPEC int orte_start_listening(void);
61 ORTE_DECLSPEC void orte_stop_listening(void);
62 ORTE_DECLSPEC int orte_register_listener(struct sockaddr* address, opal_socklen_t addrlen,
63 opal_event_base_t *evbase,
64 orte_listener_callback_fn_t handler);
65
66 #endif