Programming in C++

Discussion in 'Mac Programming' started by userlan667, Jan 1, 2007.

  1. macrumors newbie

    Joined:
    Jan 1, 2007
    #1
    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.
     
  2. Moderator emeritus

    Joined:
    Jun 25, 2002
    Location:
    Gone but not forgotten.
    #2
  3. macrumors 68000

    Soulstorm

    Joined:
    Feb 1, 2005
    #3
    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++).
     
  4. macrumors regular

    Joined:
    Nov 23, 2006
    #4
    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...
     
  5. thread starter macrumors newbie

    Joined:
    Jan 1, 2007
    #5
    I dont think Java, Ruby or Python are very good for a professional server/client VOIP program.
     
  6. Moderator emeritus

    Joined:
    Jun 25, 2002
    Location:
    Gone but not forgotten.
    #6
    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.
     
  7. macrumors regular

    Joined:
    Nov 23, 2006
    #7
    Oh, sorry I gave false information.

    Thanks for correcting me :)
     
  8. Moderator emeritus

    Joined:
    Jun 25, 2002
    Location:
    Gone but not forgotten.
    #8
    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. ;)
     
  9. macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    chicago
    #9
    what's your reasoning?
     
  10. macrumors 6502

    iancapable

    Joined:
    Oct 4, 2006
    Location:
    London, United Kingdom
    #10
    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.
     
  11. macrumors regular

    Joined:
    Feb 14, 2006
    #11
    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 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.
     
  12. macrumors 603

    jeremy.king

    Joined:
    Jul 23, 2002
    Location:
    Fuquay Varina, NC
    #12
    You have been misled.
     

Share This Page