00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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
00034 _LIT(KCobainClientPanic, "Cobainclient");
00035
00036
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
00073 TBool iIsConnected;
00074 };
00075
00076 #endif