NetBurner 3.1
fd_adapter.h
1 class fd_adapter
2 {
3  protected:
4  int my_fd;
5 
6  virtual int read(char *buf, int nbytes) = 0;
7  virtual int write(const char *buf, int nbytes) = 0;
8  virtual int close() = 0;
9  static int sread(int fd, char *buf, int nbytes);
10  static int swrite(int fd, const char *buf, int nbytes);
11  static int sclose(int fd);
12  static fd_adapter *GetFromFD(int fd);
13 
14  public:
15  int GetActiveFD();
16 };
int write(int fd, const char *buf, int nbytes)
This function writes data to the stream associated with a file descriptor (fd).
Definition: fileio.cpp:152
int read(int fd, char *buf, int nbytes)
This function reads data from a file descriptor (fd), and will block forever until at least one byte ...
Definition: fileio.cpp:288
int close(int fd)
This function closes the resources associated with a file descriptor (fd). This can be a TCP socket o...
Definition: fileio.cpp:99