Click here to Skip to main content
15,896,606 members
Articles / Programming Languages / C++

Push Framework - A C++ toolkit for high performance server development

Rate me:
Please Sign up or sign in to vote.
4.96/5 (86 votes)
23 May 2012Apache15 min read 263K   26.9K   316  
Write asynchronous, multithreaded servers in a few lines of code. Monitor realtime activity with a deploy-only dashboard.
#ifndef XMLProtocol__INCLUDED
#define XMLProtocol__INCLUDED

#pragma once

#include "Symbols.h"

class XMLProtocolImpl;

class XMLRequest;
class XMLResponse;


class XMLPROTOCOL_API XMLProtocol : public PushFramework::Protocol
{
public:
	XMLProtocol();
	~XMLProtocol();


	virtual void disposeOutgoingPacket(PushFramework::OutgoingPacket* pPacket);
	virtual void disposeIncomingPacket(PushFramework::IncomingPacket* pPacket);
	
	void registerIncomingPacketTemplate(unsigned int serviceId, PushFramework::IncomingPacket* pTemplate, unsigned int nMaxPool );
	void registerOutgoingPacketTemplate(unsigned int requestId, PushFramework::OutgoingPacket* pTemplate, unsigned int nMaxPool );

	PushFramework::OutgoingPacket* createOutgoingPacket(unsigned int requestId);
	PushFramework::IncomingPacket* createIncomingPacket(unsigned int serviceId);

	virtual int encodeOutgoingPacket(PushFramework::OutgoingPacket& packet);
	virtual int frameOutgoingPacket(PushFramework::OutgoingPacket& packet, PushFramework::DataBuffer& buffer, unsigned int& nWrittenBytes);

	virtual int tryDeframeIncomingPacket(PushFramework::DataBuffer& buffer, PushFramework::IncomingPacket*& pPacket, int& serviceId, unsigned int& nExtractedBytes);
	virtual int decodeIncomingPacket(PushFramework::IncomingPacket* pPacket, int& serviceId);


private:
	XMLProtocolImpl* pImpl;
};
#endif // XMLProtocol__INCLUDED

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Apache License, Version 2.0


Written By
Technical Lead
Tunisia Tunisia
Services:
http://www.pushframework.com/?page_id=890

Comments and Discussions