Main Page | Class Hierarchy | Data Structures | File List | Data Fields | Globals

clientsession.h

Go to the documentation of this file.
00001 /*
00002  * clientsession.h,v 1.24 2004/01/06 19:43:00 mattid Exp
00003  *
00004  * COBAIN - Communications API for EPOC Environments
00005  * Copyright (C) 2002-2004 Matti Dahlbom, Matti Kokkola
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this library; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020  *
00021  * Contact: Matti Dahlbom <matti@777-team.org>
00022  *          Matti Kokkola <matti.kokkola@iki.fi>
00023  */
00024 
00025 #ifndef __CLIENT_SESSION_H
00026 #define __CLIENT_SESSION_H
00027 
00028 #include <e32base.h>
00029 
00030 #include "cobain.h"
00031 #include "cobainserver.h"
00032 
00033 // panic category for cobain clientside
00034 _LIT(KCobainClientPanic, "Cobainclient");
00035 
00036 // panic codes
00037 const TInt KErrCCPBase = -5500;
00038 const TInt KErrCCPServerStartFailed = KErrCCPBase;
00039 
00047 class RCobainClientSession : public RSessionBase 
00048 {
00049     public:     
00050         RCobainClientSession();
00051         ~RCobainClientSession();
00052         void ConstructL();
00053 
00054         TInt Connect();
00055 
00056         void DiscoverPeers(TProtocol aProtocol, TUint aPort, 
00057                            TPckgBuf<TInt> *aPeerCountBuffer, 
00058                            TRequestStatus &aNotifyStatus); 
00059         void FetchPeerData(TInt aPeerOrdinal, TPeerDataBuf *aPeerBuffer, 
00060                            TRequestStatus &aNotifyStatus);
00061 
00062         void StartListeningL(TProtocol aProtocol, TUint aPort, TUint aExtraInfo); 
00063         void StopListening(TProtocol aProtocol, TUint aPort);
00064         void GetIncomingSocketL(TRequestStatus &aNotifyStatus);
00065         void CloseSocket(TInt aId, TBool aImmediately);
00066         RCobainSocket* ConnectSocketL(CNetworkPeer *aPeer);
00067         void Receive(TInt aSocketId, TDes8* aBuffer, TRequestStatus& aStatus);
00068         void CancelReceive(TInt aSocketId);
00069         TInt Send(TInt aSocketId, const TDesC8 *aBuf);
00070 
00071     private:
00072         // whether the session is connected to server
00073         TBool iIsConnected;
00074 };
00075 
00076 #endif

Generated on Tue Jan 13 15:47:07 2004 for CobainAPIImplementation by doxygen 1.3.5