diff options
Diffstat (limited to 'vio/VioFd.h')
-rw-r--r-- | vio/VioFd.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/vio/VioFd.h b/vio/VioFd.h new file mode 100644 index 00000000000..f1c009d848c --- /dev/null +++ b/vio/VioFd.h @@ -0,0 +1,38 @@ +/* + * Concrete Vio around a file descriptor. + */ + +#ifdef __GNUC__ +#pragma interface /* gcc class implementation */ +#endif + +VIO_NS_BEGIN + +class VioFd : public Vio +{ +public: + VioFd( int fd); + virtual ~VioFd(); + virtual bool open() const; + virtual int read( vio_ptr buf, int size); + virtual int write( const vio_ptr buf, int size); + virtual bool blocking() const; + virtual int blocking(bool onoff); + virtual int fastsend(bool onoff=true); + virtual int keepalive( bool onoff); + virtual bool fcntl() const; + virtual bool should_retry() const; + virtual int fcntl( int cmd); + virtual int fcntl( int cmd, long arg); + virtual int fcntl( int cmd, struct flock* lock); + virtual int close(); + virtual const char* description() const; + virtual const char* peer_addr() const; + virtual bool peer_name(char *buf) const; + virtual const char* cipher_description() const; +private: + int fd_; + char desc_[100]; +}; + +VIO_NS_END |