PDA

View Full Version : Programming in C++




userlan667
Jan 1, 2007, 02:45 PM
I am starting work on a cross platform VOIP server/client program. I am going to start it on my Mac then port it over the Windows later on. I talked to some people and they said the best thing to do it in is C++. The only problem that I am having is that I have no idea how to make a C++ program with a GUI on a mac and I am unable to find any example programs or tutorials on how to do this. I also am unable to find any thing on C++ programming when it comes to networks. Could anyone please tell me if C++ would actually be the best language to do this in and also provide some links to places with tutorials.



bousozoku
Jan 1, 2007, 02:56 PM
The Carbon frameworks are best used with C++. Most of the information you require can be found at http://www.apple.com/developer but there is also information available on O'Reilly's website (http://www.oreilly.com/) in the Mac section.

Soulstorm
Jan 1, 2007, 03:57 PM
I also am unable to find any thing on C++ programming when it comes to networks
That's probably because C++ is intended to be cross-platform, but network programming is platform depended. There is no such thing as network documentation on C++. There are only APIs (like Carbon and Cocoa) that will allow you to access the network capabilities of each platform.

Decide what platform you want to program for, then search the documentation available for that particular platform. Xcode has some very nice information about networking on OS X and how to access several aspects of it using the Carbon framework (you should use Carbon, since you will use C++).

bronxbomber92
Jan 1, 2007, 04:33 PM
If you want it to be cross platform, the Carbon won't work. I would suggest Java, or maybe Ruby or Python for cross platform networking...

userlan667
Jan 1, 2007, 04:51 PM
I dont think Java, Ruby or Python are very good for a professional server/client VOIP program.

bousozoku
Jan 1, 2007, 05:47 PM
If you want it to be cross platform, the Carbon won't work. I would suggest Java, or maybe Ruby or Python for cross platform networking...

Carbon is analogous to the bare Windows API. Most multiple platform applications have been written to hide the system specific APIs as much as possible. While Java works more easily on multiple platforms, it's often not preferable.

bronxbomber92
Jan 1, 2007, 06:55 PM
Oh, sorry I gave false information.

Thanks for correcting me :)

bousozoku
Jan 1, 2007, 07:55 PM
Oh, sorry I gave false information.

Thanks for correcting me :)

You're still learning. A lot of things happen on the way. You'll never know it all, but you'll meet plenty of people who think they do. ;)

zimv20
Jan 2, 2007, 04:28 AM
I dont think Java [is] very good for a professional server/client VOIP program.
what's your reasoning?

iancapable
Jan 3, 2007, 07:18 AM
I dont think Java, Ruby or Python are very good for a professional server/client VOIP program.

Why not? Java is perfectly capable of high performance stuff, including VOIP... It's also easier in the sense that it has built in memory management.

If you think it's still not good enough use GCJ and compile to native code.

mbabauer
Jan 3, 2007, 03:15 PM
I also am unable to find any thing on C++ programming when it comes to networks.

By "networks", I assume you mean networking. C++ does not have any networking stuff built-in, just as its parent C did not. Its designed to be modular in the sense that you import the stuff you need. That said, almost all OSes out there have a winsock.h or equivalant. For VOIP work, you may need to go a little more system-level, as I don't think you can do UDP using sockets (I may be wrong...been a long time since I did C++). In any light, depending on the plateform (Windows, OSX, linux, etc) there should be tons of documentation on how to open and close network connections.

If you go the C/C++ route, my suggestion would be develop your communications stuff as a generic library, then use that library on whatever GUI(s) you develop. This way you can write the core systems once and just reuse it over and over.

I dont think Java, Ruby or Python are very good for a professional server/client VOIP program.

I am not sure why you think this, but Java can be used very successfully for client/server anything. I work for a VERY large bank, and we use a lot of Java code for everything from ECommerce, to B2B, to accessing systems of records. One of the nicer things about Java is that it has built in memory management. It also has thousands of plug-in extensions, and I even believe there are some to do VOIP for you.

Given the number of RPC-type protocols out there (SOAP, CORBA, RMI, etc, etc), you could even go so far as to write the server side in C/C++ or something else, and just do the client side in Java. Keep in mind, a socket is a socket is a socket. If you put a byte of data in on one side, its still the same byte on the other.

jeremy.king
Jan 3, 2007, 03:24 PM
I dont think Java, Ruby or Python are very good for a professional server/client VOIP program.

You have been misled.