このエラーが発生しました。コードは次のとおりです。コードに vmime ライブラリを統合しました。ここで、要件に従って、特定のタイムアウト エントリ 30 秒でタイムアウト ハンドラを実装する必要があるため、コードのこの部分を実装します。
class myTimeoutHandler : public vmime :: net :: timeoutHandler {
public:
bool isTimeOut()
{
return(getTime()>=m_last + 30);
}
void resetTimeOut()
{
m_last = getTime();
}
bool handleTimeOut()
{
logMsg(DEBUG,2,"Connection Timed Out!");
return true;
}
private:
const unsigned int getTime() const
{
return vmime::platform::getHandler()->getUnixTime();
}
unsigned int m_last;
};
class myTimeoutHandlerFactory : public vmime::net::timeoutHandlerFactory
{
public:
ref <timeoutHandler> create ()
{
return vmime::create <myTimeoutHandler>();
}
};
vime::ref の代わりに ref を指定しようとしましたが、新しいエラーが発生します。
Svr.h:158: error: 'timeoutHandler' was not declared in this scope
Svr.h:158: error: template argument 1 is invalid
誰か助けてください。ありがとう
編集:
このように my.C ファイルのコードのこの部分を呼び出しています
tr->setTimeoutHandlerFactory(vmime::create <myTimeoutHandlerFactory>());