⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 securesocketcore.h

📁 this is the secure socket example seee it
💻 H
字号:
/*
============================================================================
 Name		: SecureSocketCore.h
 based on :  http://www.symbian.com/developer/techlib/v9.2docs/doc_source/examples/NetworkingEx/SSLExampleCode.guide.html#NetworkingEx%2eSSLExampleCode
 Author	  : Konstantine; Company:  Fishnest Ukraine Sebastopol
 Version	 :
 Support   : bluspan@gmail.com
 Description : CSecureSocketCore declaration
============================================================================
*/

#ifndef SECURESOCKETCORE_H
#define SECURESOCKETCORE_H

#include <e32base.h>	// For CActive, link against: euser.lib
#include <e32std.h>		// For RTimer, link against: euser.lib

//== konstantine_entrance : mycode
#include <in_sock.h>
#include <SecureSocket.h>
#include "RBufConsoleObserver.h"
//== <- my

class CSecureSocketCore : public CActive
{
public:
	// Cancel and destroy
	~CSecureSocketCore();

	// Two-phased constructor.
	static CSecureSocketCore* NewL();

	// Two-phased constructor.
	static CSecureSocketCore* NewLC();
	
	//== Konstantine_entrance : mycode 

	// ---! Secure connection !---
	
	TInt        iPort;
    TPtr8 iSndBuffer;
    TPtr8 iRcvBuffer;
    /** #bytes received */
    TInt iTotalBytesRead;
    TInetAddr   iAddress;
    RSocket iSocket;
    RSocketServ iSocketServer;
    TSockXfrLength iBytesSent;
    CSecureSocket* iTlsSocket;
    
    // To save logs into RBuf console
    CRBufConsoleObserver *iRBufConsoleObserver;
	
    // ---! Methods !---
    
    void SetRBufConsoleObserver(CRBufConsoleObserver *aObserver);
    
	void ConnectL()             ;
	void MakeSecureConnectionL();
	void MakePageRequestL()     ;
	void GetServerResponseL()   ;
	void ReadServerResponseL()  ;
	void ConnectionStop()       ;
	//== <- my

public: // New functions
	// Function for making the initial request
	void StartL( TTimeIntervalMicroSeconds32 aDelay );

private:
	// C++ constructor
	CSecureSocketCore();
	
	// Second-phase constructor
	void ConstructL();
	
private: // From CActive
	// Handle completion
	void RunL();
	
	// How to cancel me
	void DoCancel();
	
	// Override to handle leaves from RunL(). Default implementation causes
	// the active scheduler to panic.
	TInt RunError( TInt aError );

private:
	enum TSecureSocketCoreState
	{
		EUninitialized,	// Uninitialized
		EInitialized,	// Initalized
		EMakingSecureConnection,
		EMakingPageRequest,
		EGettingServerResponse,
		EDataReceived,
		EStopping,	    // Going to stop
		EStopped,	    // Stopped
		EError			// Error condition
	};

private:
	TInt	iState;		// State of the active object
	RTimer	iTimer;		// Provides async timing service

};

#endif // SECURESOCKETCORE_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -