Rudiments
filedescriptor.h
1 // Copyright (c) 2002 David Muse
2 // See the COPYING file for more information.
3 
4  protected:
5 
6  void filedescriptorInit();
7  void filedescriptorClone(const filedescriptor &f);
8 
9  virtual ssize_t bufferedRead(void *buf, ssize_t count,
10  int32_t sec, int32_t usec) const;
11  virtual ssize_t bufferedWrite(const void *buf, ssize_t count,
12  int32_t sec, int32_t usec) const;
13  virtual ssize_t safeRead(void *buf, ssize_t count,
14  int32_t sec, int32_t usec) const;
15  virtual ssize_t safeWrite(const void *buf, ssize_t count,
16  int32_t sec, int32_t usec) const;
17  bool setNoDelay(int32_t onoff);
18 
19  #ifdef RUDIMENTS_HAS_SSL
20  virtual void *newSSLBIO() const;
21  #endif
22 
23  int32_t getSockOpt(int32_t level, int32_t optname,
24  void *optval, socklen_t *optlen);
25  int32_t setSockOpt(int32_t level, int32_t optname,
26  const void *optval, socklen_t optlen);
27 
28  virtual ssize_t lowLevelRead(void *buf,
29  ssize_t count) const;
30  virtual ssize_t lowLevelWrite(const void *buf,
31  ssize_t count) const;
32  virtual int32_t lowLevelClose();
33 
34  const char *type() const;
35  void type(const char *tp);
36 
37  int32_t fd() const;
38  void fd(int32_t filedes);
39 
40  #ifdef RUDIMENTS_HAS_SSL
41  void *ctx();
42  void *ssl();
43  int32_t sslresult();
44  void sslresult(int32_t sslrslt);
45  #endif
46 
47  private:
48  filedescriptorprivate *pvt;
49 
50  public:
51  filedescriptor(int32_t fd);
Definition: filedescriptor.h:14