Rudiments

filedescriptor.h
1 // Copyright (c) 1999-2018 David Muse
2 // See the COPYING file for more information.
3
4 friend class securitycontext;
5 friend class gsscontext;
6 friend class tlscontext;
7 protected:
8
9 void filedescriptorInit();
10 void filedescriptorClone(const filedescriptor &f);
11
12 virtual ssize_t bufferedRead(void *buf, ssize_t count,
13 int32_t sec, int32_t usec);
14 virtual ssize_t bufferedWrite(const void *buf, ssize_t count,
15 int32_t sec, int32_t usec);
16 virtual ssize_t safeRead(void *buf, ssize_t count,
17 int32_t sec, int32_t usec);
18 virtual ssize_t safeWrite(const void *buf, ssize_t count,
19 int32_t sec, int32_t usec);
20 bool setNoDelay(int32_t onoff);
21
22 int32_t getSockOpt(int32_t level, int32_t optname,
23 void *optval, socklen_t *optlen);
24 int32_t setSockOpt(int32_t level, int32_t optname,
25 const void *optval, socklen_t optlen);
26
27 virtual ssize_t lowLevelRead(void *buf,
28 ssize_t count);
29 virtual ssize_t midLevelWrite(const void *buf,
30 ssize_t count);
31 virtual ssize_t lowLevelWrite(const void *buf,
32 ssize_t count);
33 virtual int32_t lowLevelClose();
34
35 const char *type() const;
36 void type(const char *tp);
37
38 int32_t fd() const;
39 void fd(int32_t filedes);
40
41 securitycontext *secctx();
42
43 private:
44 static void lowLevelWriteWorker(void *attr);
45 filedescriptorprivate *pvt;
46
47 public:
48 filedescriptor(int32_t fd);
49 static void *getHandleFromFileDescriptor(int32_t fd);
50
51 void useAsyncWrite();
52 void dontUseAsyncWrite();
filedescriptor
Definition: filedescriptor.h:13
gsscontext
Definition: gss.h:230
securitycontext
Definition: security.h:16
tlscontext
Definition: tls.h:18