Click here to Skip to main content
13,799,872 members
Click here to Skip to main content

Tagged as

Stats

204.2K views
25.3K downloads
310 bookmarked
Posted 23 Mar 2011
Licenced Apache

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

, 23 May 2012
Write asynchronous, multithreaded servers in a few lines of code. Monitor realtime activity with a deploy-only dashboard.
ChatAPI
ChatAPI.vcproj
ChatClient
ChatClient.vcproj
res
.svn
entries
prop-base
ChatClient.ico.svn-base
props
text-base
ChatClient.ico.svn-base
ChatClient.rc2.svn-base
tmp
prop-base
props
text-base
ChatClient.ico
ChatPackets
ChatPackets.vcproj
ChatProtocol
ChatProtocol.vcproj
ChatServer
ChatServer.vcproj
ChatServer.vcproj.INTERNAL.Ahmed.Charfeddine.user
output
TCPSocket
TCPSocket.vcproj
TCPSocket.zip
XMLProtocol
XMLProtocol.vcproj
XMLProtocol.zip
ChatRobots
ChatRobots.vcproj
ProtoBufExampleClient
ProtoBufExampleClient.vcproj
ProtoBufExampleProtocol
ProtoBufExampleProtocol.vcproj
ProtoBufExampleServer
ProtoBufExampleServer.vcproj
include
PushFramework.dll
PushFramework.lib
private
PushFramework.vcproj
QoSExampleClient
QoSExampleClient.vcproj
QoSExampleProtocol
QoSExampleProtocol.vcproj
QoSExampleServer
QoSExampleServer.vcproj
#include "StdAfx.h"
#include "JoinRoomRequestService.h"

#include "ChatParticipant.h"

JoinRoomRequestService::JoinRoomRequestService(void)
{
}

JoinRoomRequestService::~JoinRoomRequestService(void)
{
}

void JoinRoomRequestService::handle( ClientKey clientKey, PushFramework::IncomingPacket* pRequest )
{
	ChatParticipant* pParticipant = (ChatParticipant*) getServer()->getClientFactory()->getClient(clientKey);
	if(!pParticipant)
		return;

	JoinRoomRequest* request = (JoinRoomRequest*) pRequest;

	std::string roomName = request->Room();

	getServer()->getBroadcastManager()->subscribeClient(clientKey, roomName.c_str());

	JoinRoomResponse* pResponse = new JoinRoomResponse;
	pResponse->Room(roomName);

	pParticipant->pushPacket(pResponse);

	getServer()->getClientFactory()->returnClient(clientKey);
}

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

Share

About the Author

Ahmed Charfeddine
Technical Lead
Tunisia Tunisia
Services:
http://www.pushframework.com/?page_id=890

You may also be interested in...

Pro
Pro
Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web04 | 2.8.181214.1 | Last Updated 23 May 2012
Article Copyright 2011 by Ahmed Charfeddine
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid