Click here to Skip to main content
15,921,113 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm working on a new project. (Yay)

A server designated to be talking to an application that I'm building for smartphones, and meddle with the data sent by the phone.

I have a current server design which I'm using in other C# programs that I'm writing, and it proved to be sufficient so far, but it was designed for much smaller amount of connections but probably sending data more frequently that the current design might require.

My requirements from my server design are the following:

A. support of infinite amount of users at the same time (you know... infinite... Well, it shouldn't be a problem. Also, the design can assume that most of the server's work is crunching user-supplied data - which is very little - probably using a database - and send the results and updates to the users once in a while).

B. The user sends mostly short packets (again, very sparsely... most of the time the connection remains inactive), sometimes the user sends some bigger packets, but not very often.

C. The server must be capable of sending data to a user, even when unprovoked (without a specific request from the user), and can't create a new connection by connecting to a listening socket within the application, because there's no way that they server can determine where to find the client (even if storing the last IP address, that would be a security hazard).

My current design is using C# sockets with async callbacks (BeginReceive, etc.) is it necessary to convert it into a C++ server? How big is the performance difference between C# and C++ when talking about sockets using the thread pool...

Is it necessary that I will have multiple servers in order to handle so many clients, that would just gather the data and send them to a main frame? You know, instead of having one server, both handling all the clients and "doing the math".
Posted
Updated 21-Oct-11 0:03am
v2

1 solution

You may want to take a look at:
ActiveMQ[^] - your application sounds like a natural candidate for message queuing.

Best regards
Espen Harlinn
 
Share this answer
 
Comments
ShacharK 21-Oct-11 7:52am    
I am using a queue of messages.
Espen Harlinn 21-Oct-11 11:53am    
Perhaps you already have something excellent, and as I really don't know the capabilities of your solution I can just try to point you in what I think is the right direction. A full blown message queueing solution allows communication between partially connected devices - you post a message to a queue and the system takes care of delivery - some systems are built to be fault tolerant and ensures that messages are delivered even if the server goes down and restarted.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900