?? gprsclient.h
字號:
/* Copyright (c) 2002, Nokia Mobile Phones. All rights reserved */
#ifndef __GPRSCLIENT_H__
#define __GPRSCLIENT_H__
#include <e32base.h>
#include <es_sock.h>
#include <in_sock.h>
#include <e32des16.h>
#include <e32des8.h>
#include "GprsClient.h"
class MDbObserver
{
public:
virtual void ResponseReceived(TDesC8 &aResponse) = 0;
};
class CGprsClient : public CActive
{
public:
static CGprsClient* NewL(MDbObserver *aCallb);
static CGprsClient* NewLC(MDbObserver *aCallb);
~CGprsClient();
TBool IsConnected();
TBool IsBusy();
//start the sequence of sending a prepared http packet to the server
void SendL(TInetAddr &iIpAddress, const TDesC8& aDesc);
public:
void SetSocket(RSocket* aSocket);
void StartGprsSession();
protected: // from CActive
void DoCancel();
//from CActive, called whenever an event or error occurs
void RunL();
private:
//actually send the packet
void DoSendL();
//start receiving a packet from the server
void DoReceiveL();
//apend received packet to buffer
void AppendToReceiveBuffer();
//finish the connection to the server
void FinishConnectionL();
CGprsClient(MDbObserver *aCallb);
void ConstructL();
//show a messagebox to the user
void MessageBox(const TDesC& aMessage);
private:
enum TState
{
ENotConnected,
EGettingConnection,
ESending,
EReceiving
//EDisconnecting
};
TState iState;
RSocketServ iSocketServer;
RSocket *iSocket;
MDbObserver *iCallb;
// TBuf<20> iAddrString;
TBuf8<10000> iData;
TBuf8<1024> iRecvBuffer;
TSockXfrLength iLen;
};
#endif // __GPRSCLIENT_H__
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -