Rudiments
/home/dmuse/src/rudiments/include/rudiments/private/filedescriptor.h
00001 // Copyright (c) 2002 David Muse
00002 // See the COPYING file for more information.
00003 
00004         friend class timezonefile;
00005         protected:
00006 
00007                 void    filedescriptorInit();
00008                 void    filedescriptorClone(const filedescriptor &f);
00009 
00010                 virtual ssize_t bufferedRead(void *buf, ssize_t count,
00011                                                 long sec, long usec) const;
00012                 virtual ssize_t bufferedWrite(const void *buf, ssize_t count,
00013                                                 long sec, long usec) const;
00014                 virtual ssize_t safeRead(void *buf, ssize_t count,
00015                                                 long sec, long usec) const;
00016                 virtual ssize_t safeWrite(const void *buf, ssize_t count,
00017                                                 long sec, long usec) const;
00018                 virtual int32_t safeSelect(long sec, long usec,
00019                                                 bool read, bool write) const;
00020                 virtual int32_t safePoll(long sec, long usec,
00021                                                 bool read, bool write) const;
00022                 bool            setNoDelay(int32_t onoff);
00023 
00024                 #ifdef RUDIMENTS_HAS_SSL
00025                 virtual BIO     *newSSLBIO() const;
00026                 #endif
00027 
00028                 int32_t getSockOpt(int32_t level, int32_t optname,
00029                                         void *optval, socklen_t *optlen);
00030                 int32_t setSockOpt(int32_t level, int32_t optname,
00031                                         const void *optval, socklen_t optlen);
00032 
00033                 virtual ssize_t lowLevelRead(void *buf,
00034                                                 ssize_t count) const;
00035                 virtual ssize_t lowLevelWrite(const void *buf,
00036                                                 ssize_t count) const;
00037                 virtual int32_t lowLevelClose();
00038 
00039                 const char      *type() const;
00040                 void            type(const char *tp);
00041 
00042                 int32_t fd() const;
00043                 void    fd(int32_t filedes);
00044 
00045                 #ifdef RUDIMENTS_HAS_SSL
00046                 SSL_CTX *ctx();
00047                 SSL     *ssl();
00048                 int32_t sslresult();
00049                 void    sslresult(int32_t sslrslt);
00050                 #endif
00051 
00052         private:
00053                 filedescriptorprivate   *pvt;