nds2-client - ClientDeveloper  0.16.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
daqc_listener.h
Go to the documentation of this file.
1 /* -*- tab-width:8 c-basic-offset:4 indent-tabs-mode:nil -*- */
2 /* set vi: ts=8:softtabstop=4,shiftwidth=4,expandtab */
3 
4 #ifndef DAQ_LISTENER_H
5 #define DAQ_LISTENER_H
6 
7 #include "daqc.h"
8 
9 struct sockaddr_in;
10 
11 #if HAVE_PTHREAD_H
12 typedef pthread_t thread_t;
13 typedef pthread_mutex_t mutex_t;
14 #elif _WIN32
15 typedef HANDLE thread_t;
16 typedef HANDLE mutex_t;
17 #else /* HAVE_PTHREAD_H */
18 #endif /* HAVE_PTHREAD_H */
19 
20 #ifndef VXWORKS
21 
63 typedef struct
64 {
65 
68 
70  struct sockaddr_in* listener_addr;
71 
73  void* ( *interpreter )( void* );
74 
78 
80  thread_t listener_tid;
81 
83  thread_t interpreter_tid;
84 
87  mutex_t lock;
88 
89 } daq_listen_t;
90 
107  daq_t* daq,
108  int* tcp_port,
109  void* ( *start_func )(void*));
110 
122 int daq_shutdown( daq_listen_t* lstn );
123 
127 #endif /* defined(VXWORKS) */
128 #endif /* defined(DAQ_LISTENER_H) */
daq_listen_t * daq_initialize(daq_listen_t *lstn, daq_t *daq, int *tcp_port, void *(*start_func)(void *))
Create a network listener thread.
Definition: daqc_listener.c:395
thread_t listener_tid
Definition: daqc_listener.h:80
Definition: daqc_listener.h:63
mutex_t lock
Definition: daqc_listener.h:87
int daq_shutdown(daq_listen_t *lstn)
Kill the listener thread.
Definition: daqc_listener.c:490
NDS1/2 client status structure.
Definition: daqc.h:232
int shutting_down
Definition: daqc_listener.h:77
daq_t * daq
Definition: daqc_listener.h:67
struct sockaddr_in * listener_addr
Definition: daqc_listener.h:70
thread_t interpreter_tid
Definition: daqc_listener.h:83