Update contrib.
1 #ifndef __SNTPCLIENTENGINE_H__
2 #define __SNTPCLIENTENGINE_H__/*
3 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
5 * This component and the accompanying materials are made available
6 * under the terms of the License "Eclipse Public License v1.0"
7 * which accompanies this distribution, and is available
8 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
10 * Initial Contributors:
11 * Nokia Corporation - initial contribution.
24 #include "commandlineargs.h"
26 enum TSNTPClientState {
39 virtual void TimerExpired() = 0;
44 class CTimeOutTimer: public CTimer
47 static CTimeOutTimer* NewL(const TInt aPriority, MTimeOutNotify& aTimeOutNotify);
51 CTimeOutTimer(const TInt aPriority);
52 void ConstructL(MTimeOutNotify& aTimeOutNotify);
56 MTimeOutNotify* iNotify;
59 // The main client engine
61 class CSNTPClient : public CActive, public MTimeOutNotify
65 static CSNTPClient* NewL(TCommandLineArgs& aArgs);
66 static CSNTPClient* NewLC(TCommandLineArgs& aArgs);
68 TSNTPClientState State();
74 CSNTPClient(TCommandLineArgs& aArgs);
81 TInt RunError(TInt aError);
83 /* MTimeOutNotify methods */
89 RSocketServ iSockServ;
91 RHostResolver iResolver;
93 TCommandLineArgs& iArgs;
94 TSNTPClientState iState;
95 TNameEntry iNameEntry;
97 CTimeOutTimer* iTimer;
99 // An NTP packet is exactly 48 bytes
107 #endif /* _SNTPCLIENTENGINE_H__ */