stream_pool_fraction.h
1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef SCOT_STREAM_POOL_FRACTION_H
#define SCOT_STREAM_POOL_FRACTION_H
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <scot/stream_pool.h>
#include <scot/event_listener.h>
#include <scot/scot_int.h>
#include <scot/stream.h>
#include <scot/thread.h>
#define SCOT_MAX_FRACTION 64 /* Windows kann max. 64 Objekte pro thread
überwachen. */
struct scot_sp_fraction
{
struct scot_event_listener * el;
int stream_type; /* what streams to accept */
THREAD_T thread_handle;
THREAD_ID_T thread_id;
int thread_run_flg;
scot_thread_entry_fptr spf_entry_func;
uint16_t s_count;
struct scot_stream * s_list [SCOT_MAX_FRACTION];
int free_s;
/* for select */
fd_set rfds, wfds, efds;
int max_fd;
};
extern scot_thread_entry_fptr scot_spf_thread_func[];
struct scot_sp_fraction * scot_spf_new (struct scot_sp_fraction *,
struct scot_event_listener *,
int);
void scot_spf_free (struct scot_sp_fraction *);
void scot_spf_free_s (struct scot_sp_fraction *,
int);
void scot_spf_add (struct scot_sp_fraction *,
struct scot_stream *,
int);
void scot_spf_remove (struct scot_sp_fraction *,
struct scot_stream *,
int);
#endif /* SCOT_STREAM_POOL_FRACTION_H */