103 virtual void close();
104 virtual bool isok()
const;
105 virtual size_t uread(
void *buf,
size_t count);
106 virtual size_t uwrite(
const void *buf,
size_t count);
112 const char *wstype()
const {
return "WvFdStream"; }
117 #endif // __WVFDSTREAM_H void setfd(int fd)
Sets the file descriptor for both reading and writing.
void set_close_on_exec(bool close_on_exec)
Make the fds on this stream close-on-exec or not.
virtual void pre_select(SelectInfo &si)
pre_select() sets up for eventually calling ::select().
int getfd() const
Returns the Unix file descriptor for reading and writing.
virtual void maybe_autoclose()
Auto-close the stream if the time is right.
virtual ~WvFdStream()
Destroys the stream and invokes close().
Unified support for streams, that is, sequences of bytes that may or may not be ready for read/write ...
bool shutdown_read
Have we actually shut down the read/write sides?
virtual bool isok() const
return true if the stream is actually usable right now
the data structure used by pre_select()/post_select() and internally by select(). ...
virtual void close()
Closes the file descriptors.
Base class for streams built on Unix file descriptors.
int wfd
The file descriptor for writing.
int rfd
The file descriptor for reading.
void set_nonblock(bool nonblock)
Make the fds on this stream blocking or non-blocking.
int getrfd() const
Returns the Unix file descriptor for reading from this stream.
virtual bool post_select(SelectInfo &si)
post_select() is called after ::select(), and returns true if this object is now ready.
virtual size_t uwrite(const void *buf, size_t count)
unbuffered I/O functions; these ignore the buffer, which is handled by write().
WvFdStream(int rwfd=-1)
Creates a WvStream from an existing file descriptor.
virtual size_t uread(void *buf, size_t count)
unbuffered I/O functions; these ignore the buffer, which is handled by read().
int getwfd() const
Returns the Unix file descriptor for writing to this stream.