Fix compile issues, slight code cleanup

This commit is contained in:
rdb 2014-10-08 20:07:46 +00:00
parent 7524299de9
commit 9151cd0d1d
2 changed files with 67 additions and 71 deletions

View File

@ -6,8 +6,8 @@
enum CloseState enum CloseState
{ {
ConnectionDoNotClose, ConnectionDoNotClose,
ConnectionDoClose ConnectionDoClose
}; };
// RHH // RHH
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
@ -27,8 +27,8 @@ enum CloseState
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template < class _INCLASS1,class _IN_LISTEN, class MESSAGE_READER_BUF, class MESSAGE_READER_UPPASS> class BaseIncomingSet : public std::list<_INCLASS1 *> template < class _INCLASS1,class _IN_LISTEN, class MESSAGE_READER_BUF, class MESSAGE_READER_UPPASS> class BaseIncomingSet : public std::list<_INCLASS1 *>
{ {
typedef std::list<_INCLASS1 *> BaseClass; typedef std::list<_INCLASS1 *> BaseClass;
typedef TYPENAME BaseClass::iterator iterator; typedef TYPENAME BaseClass::iterator iterator;
_IN_LISTEN _Listener; _IN_LISTEN _Listener;
inline void AddFromListener(void); inline void AddFromListener(void);
@ -50,10 +50,6 @@ public:
virtual CloseState ProcessNewConnection(SOCKET socket); virtual CloseState ProcessNewConnection(SOCKET socket);
inline void AddToFDSet(Socket_fdset &set); inline void AddToFDSet(Socket_fdset &set);
// inline LinkNode * GetRoot(void) { return &this->sentenal; }; // inline LinkNode * GetRoot(void) { return &this->sentenal; };
BaseIncomingSet &operator=( BaseIncomingSet &inval); BaseIncomingSet &operator=( BaseIncomingSet &inval);
void Reset(); void Reset();

View File

@ -46,7 +46,7 @@ inline int BaseIncomingSet<_INCLASS1,_IN_LISTEN,MESSAGE_READER_BUF,MESSAGE_READE
if(ans < 0) if(ans < 0)
{ {
delete *lp; delete *lp;
erase(lp); this->erase(lp);
} }
if(ans > 0) if(ans > 0)
{ {
@ -54,7 +54,7 @@ inline int BaseIncomingSet<_INCLASS1,_IN_LISTEN,MESSAGE_READER_BUF,MESSAGE_READE
if( cs == ConnectionDoClose) if( cs == ConnectionDoClose)
{ {
delete *lp; delete *lp;
erase(lp); this->erase(lp);
} }
} }
} }
@ -194,7 +194,7 @@ inline void BaseIncomingSet<_INCLASS1,_IN_LISTEN,MESSAGE_READER_BUF,MESSAGE_READ
lpNext++; lpNext++;
(*lp)->Reset(); (*lp)->Reset();
delete *lp; delete *lp;
erase(lp); this->erase(lp);
} }
} }