Click here to Skip to main content
15,904,638 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hello

I need some help, I am a complete beginner with C++ and I am try to develop a program for the company I work for.

What I need is two applications a host app and a server app.

When loaded the host needs to search for all available servers and show a list to choose from. It will then need to send and receive data to and from the server in real time.

When loaded the server needs to broadcast its location so the host app can locate it. It then needs to receive from the host app, process it and send it back in real time.

I would like to have this run on both x32 and x64.

I do not want someone to do all of this for me as I want to use this as a learning experience I just need some guidance. if possible I would like to use Skype or MSN to communicate.

Thank you
Posted
Comments
Albert Holguin 25-May-11 10:24am    
this is not a beginner project
Joan M 25-May-11 10:53am    
Don't post comments or questions as answers... no one will see it and if you have specific questions to specific posts that other users have posted here, you should ask them directly using the REPLY link on the right side of their posts... Moreover... I agree 100% Albert... this is not by any means a beginner project... You should remove the post you've made and post it in the right place...
Geoff Joness 25-May-11 12:01pm    
I'm sure it is not a beginner project, but I never asked or said it was. This is what I need to get done regardless of complexity.

@Joan thanks for the tip I didnt see that reply button.

If you can help I would appreciate it, if not don't waste your time telling me this isn't for beginners as that does not help me
Gonzoox 25-May-11 15:22pm    
I will help you, for an hourly fee... not for free
Albert Holguin 26-May-11 14:04pm    
"I am a complete beginner with C++"... and nope, won't help you one bit

For some starter guidance: :)
In order to get anywhere here you need to tell us what basic kind of a Real Time System you are out for:

  1. Hard
  2. Firm
  3. Soft


The choice is very important as it will narrow or widen the available OS' on which your solution can be deployed.

Best Regards,

-MRB
 
Share this answer
 
Comments
Sandeep Mewara 25-May-11 10:51am    
Comment from OP:
Sorry I do not know what mean by

Hard
Firm
Soft

As for OS'

Windows 7 x32 and x64
Sergey Alexandrovich Kryukov 25-May-11 13:11pm    
Plan for "very soft" -- this is feasible.
My 5 for Manfred!
--SA
Sergey Alexandrovich Kryukov 25-May-11 13:32pm    
I added my answer about real time. Please see!
--SA
Espen Harlinn 27-May-11 8:45am    
Good point, my 5
The OS is the first possible problem here... not all of them are deterministic... imagine Windows... if you need to process something in real time and the OS starts defragmenting or you launch another application that could need a lot of resources that could reduce the resource pool available for your application...

i.e. Imagine an app to control an inverse pendulum using a computer... and that you suddenly put a floppy disk in the A: unit and start writing information into it... probably the pendulum will fall...

Depending on the real needs of your "real time" you will be fine... if not... you can be in a really big problem...

You will have to determine the way you need to process the data:

- getting all the information always.
- allowing the program to reject some packets as they are out of the good time to be received...
...

Give us more details and we will extend our answer...

Anyway... good luck with that "beginner" project...
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 25-May-11 13:13pm    
Most Windows things are deterministic but not timing. It will be very soft real-time, which is not technically a true real-time at all, but it should be quite adequate for the application.
My 5.
--SA
Sergey Alexandrovich Kryukov 25-May-11 13:32pm    
I added my answer about real time. Please see!
--SA
In addition to the answer by Manfred: this is some basic explanation of real time.

Hard real time system is the system where the maximum latency of some time-critical response can be found in advance, and the system must guarantee 100% probability of completion of the response in this time frame. This is pretty hard to achieve in principle. This is not about certain time itself, this is about the guarantee of response in time.

In one typical scenario, some part of throughput is sacrificed to the guarantee. The whole idea of hard real time is always related to the control of some hardware and processing driven by a hardware interrupt.

If you think about Windows in general you will understand that the hard real-time properties have nothing to do with Windows. Even if you apply real-time priority for a Windows thread/process, it won't guarantee certain predictable latency as this latency will depend on current operational status of the system (more or less busy with other priority threads, status of the cache of all levels (important limiting factor!) and stuff like that. If Ethernet is involved (set aside absolutely non-deterministic Internet), it's always introduces some probability of unlimited delays, as Ethernet architecture of resolution of clashes is totally based on a non-deterministic algorithm. Theoretically speaking, its possible to guarantee some slower hard real-time networking for a network with fixed number of players by scheduling and throttling all players in order to avoid conflicts; it should be based on some single central arbitrator device.

Everything outside the realm of hard real time is called soft real-time or something like that. I'm not sure if there is a commonly accepted and valid classification of not hard real time systems.
See http://en.wikipedia.org/wiki/Real-time_computing[^] and http://en.wikipedia.org/wiki/Real-time_operating_system[^].

Sometimes people call real-time something very specific. For example, there is a common term "real-time" applied to some important sub-system, such as related to multimedia. Needless to say that a media player, for example, should guarantee the fixed audio tempo and/or fixed frame rate. In this sense, it is really a hard real-time subsystem but— until the user does something active and CPU time consuming in parallel. In real life that video may start stalling. This is kind a real time but not of the true kind. True hard real time is used it military, transport systems and the like.

—SA
 
Share this answer
 
v7
Comments
Manfred Rudolf Bihy 26-May-11 4:18am    
Good job laying it out like this SA.
Actually my answer was an experiment. I tried to see if I could coax OP into doing some basic research on the subtle differences of Real-Time processing requirements.

I have utterly failed in doing so. :'(
The experiment was a failure ...
Sergey Alexandrovich Kryukov 26-May-11 12:24pm    
Thank you very much, Manfred.

Sorry for the failure. In experimental science a failure is a valuable result, too.
I appreciate your answer and the idea to answer this way. It was quite reasonable.
I'm afraid your answer could be understood as just a joke. :-)

In this case I don't think it was a failure yet.
The real research in real-time processing can take a researcher's lifetime...
--SA
Espen Harlinn 27-May-11 8:43am    
Good points, my 5!
Sergey Alexandrovich Kryukov 27-May-11 11:00am    
Thank you, Espen.
--SA
Take a look at ACE[^], The ADAPTIVE Communication Environment and TAO[^], Real-time CORBA with TAO.

As you can see here: ACE, TAO, and CIAO Success Stories[^] - this is used by some serious players in the field of real-time development.

Here is a short tutorial: ACE programmers Guide[^]

Here are some books on ACE:
http://www.riverace.com/acebooks/index.htm[^]

Best regards
Espen Harlinn
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 26-May-11 12:30pm    
ACE and TAO again. Good to know it's related to real-time.
My 5.
--SA
Espen Harlinn 26-May-11 13:28pm    
Thanks SAKryukov!
One more thing to investigate: the requirement of "search all available servers", unless you are in a very small and controlled environment, is a nonsense in today's Internet mainly for two reasons:
- There is no concept of "World-Wide broadcast". Fortunately! (imagine what the activity of every network interface allover the world would be if such a mechanism existed and went abused!)
- That said, you can heuristically scan all the available addresses and ports to try to get meaningful answers from them. It can take days, and your behavior can be considered "viral" and your address blocked as "malicious".

A more proper way to solve this problem is
- Define a "well known place(s)" (whose address(es) is (are) supposed to be already known, or easily queried by a DNS) where all of your server register their availability and status, and all of your client can ask for the "best available server" or for the "list of registered servers".
- Define an authentication mechanism to allow only authorized server to be really able to join this "registration service" and only authorized clients to access the given information. The security of such a mechanism (just a plain ID/password, individual password, challenge-token based, etc.) depends on the protection level you need.
Note that such a task is -before than an algorithm- the definition of a "protocol".

Note that the Dynamic-DNS protocol itself allows to solve the problem, if you register a "service locator record" and bind to that "service" all of your servers. If you refer to such method you have the advantage to have a "standard Internet application" that can be used mostly everywhere.

Once a client has located an appropriate server, normal socket programming is needed to transfer data. But -again- consider the advantage to use a standard protocol like (for example) HTTP: in its basic functionality is relatively simple to be implemented (you don't need to parse whatever HTML, if not required). That will give to your application the necessary openness to evolve even in a variety of different form and formats.
 
Share this answer
 
Comments
Albert Holguin 26-May-11 14:09pm    
your comment on world-wide broadcast is a bit off the mark... trojans have been using this technology for years now... except it isn't a literal broadcast, they usually go to a web server to check in
Emilio Garavaglia 26-May-11 15:37pm    
What do you mean with "off teh mark"?
Trojans, if using boradacsts, use IP broadcasts or MAC broadcasts, that -by nature- are "subnet directed" or "subnet local". One router in between, and they don't propagate. IP doesn't have any concept of "global broadcast".
Can you post an example of such a "broadcast address"?
Albert Holguin 26-May-11 15:39pm    
he wants the effect of broadcasting, not literal broadcast... you take a self-identified newbies terms literally?
Emilio Garavaglia 27-May-11 2:00am    
Nope. But when they use incorrect or improper term I correct them.
That's what experience is for, after all!
But you didn't answer my question ...
Never mind.

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