localconnectivityservice/dun/server/inc/DunSession.h
author hgs
Fri, 15 Oct 2010 15:05:57 +0800
changeset 54 4dc88a4ac6f4
parent 29 3ae5cb0b4c02
permissions -rw-r--r--
201041_02
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     1
/*
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     2
* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     3
* All rights reserved.
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     8
*
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     9
* Initial Contributors:
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    11
*
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    12
* Contributors:
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    13
*
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    14
* Description:  The session object for DUN server
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    15
*
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    16
*/
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    17
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    18
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    19
#include "DunServer.h"
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    20
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    21
#ifndef C_CDUNSESSION_H
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    22
#define C_CDUNSESSION_H
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    23
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    24
/**
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    25
 *  Manages separate DUN server sessions for client(s)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    26
 *
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    27
 *  @since S60 v3.2
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    28
 */
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    29
NONSHARABLE_CLASS( CDunSession ) : public CSession2
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    30
    {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    31
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    32
public:
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    33
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    34
    CDunSession( CDunServer* aDunServer );
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    35
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    36
    /**
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    37
    * Destructor.
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    38
    */
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    39
    virtual ~CDunSession();
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    40
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    41
    /**
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    42
     * Return the version number
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    43
     *
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    44
     * @since S60 3.2
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    45
     * @return Version number
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    46
     */
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    47
    TVersion Version() const;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    48
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    49
// from base class CSession2
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    50
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    51
    /**
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    52
     * From CSession2.
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    53
     * Handles the servicing of client requests passed to the server
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    54
     *
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    55
     * @since S60 3.2
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    56
     * @param aMessage Message containing the client request
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    57
     * @return None
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    58
     */
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    59
    void ServiceL( const RMessage2 &aMessage );
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    60
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    61
    /**
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    62
     * From CSession2.
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    63
     * Return a reference to DUN server
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    64
     *
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    65
     * @since S60 3.2
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    66
     * @return Server reference
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    67
     */
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    68
    CDunServer& Server() const;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    69
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    70
private:
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    71
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    72
    /**
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    73
     * Handles incoming service messages
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    74
     *
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    75
     * @since S60 3.2
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    76
     * @param aMessage Message containing the client request
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    77
     * @return Symbian error code on error, KErrNone otherwise
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    78
     */
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    79
    TInt DoService( const RMessage2& aMessage );
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    80
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    81
    /**
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    82
     * Handles incoming test service messages
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    83
     *
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    84
     * @since S60 5.0
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    85
     * @param aMessage Message containing the client request
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    86
     * @return Symbian error code on error, KErrNone otherwise
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    87
     */
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    88
    TInt DoTestService( const RMessage2& aMessage );
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    89
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    90
private:  // data
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    91
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    92
    /**
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    93
     * Message containing the client request
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    94
     */
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    95
    RMessage2   iMessage;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    96
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    97
    /**
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    98
     * Pointer to DUN server
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    99
     * Not own.
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   100
     */
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   101
    CDunServer* iDunServer;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   102
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   103
};
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   104
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   105
#endif  // C_CDUNSESSION_H