Simple Network Code

Discussion in 'Mac Programming' started by CylonGlitch, Mar 27, 2010.

  1. CylonGlitch macrumors 68030

    CylonGlitch

    Joined:
    Jul 7, 2009
    Location:
    SoCal
    #1
    Anyone have any simple network code? I have the need for a very simple network application in Objective.C. I have two applications that need to send some very simple data back and forth, nothing fancy, just simple communications. The applications don't need to search for each other, IP address can be supplied.

    Basically something like a VERY simple chat app. You put in the IP address, and whatever you type, shows up on the other app's display. That's it.

    Anyone know of where I can either find this code, or if someone has something already written that I can use as a foundation for my code.

    Thanks!
     
  2. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #2
    Use AsyncSocket:
    http://code.google.com/p/cocoaasyncsocket/

    It's pretty easy to work with, if you have some Cocoa skills. The first time I used it, I was very new to Cocoa and Objective-C, but quite experienced with Java and other programming languages. I had it interoperating with Java networking apps in only a few days worth of playing with it.

    Since you didn't indicate your skill or experience level, there's no way to tell what you will find easy.

    You didn't indicate your network programming experience, either, so the idea of "a simple chat app" may not be as simple as you might think. It may seem simple on the surface, from a user perspective, but that isn't necessarily a reflection of what the code or design is like.

    It's like arithmetic and algebra. If you know arithmetic, then ideas like variables and equations (relationships between variables) is at least explainable. But if you don't know basic arithmetic, then even rudimentary algebra is impossible to understand.

    Oh, and get yourself a network traffic-watching tool. Old school command-line: tcpdump. Tool for anyone: Interarchy. More DIY: wireshark. You can google any of those.
     
  3. CylonGlitch thread starter macrumors 68030

    CylonGlitch

    Joined:
    Jul 7, 2009
    Location:
    SoCal
    #3
    Thanks for the information, I will download it and get going with it. I have some good Objective-C experience but I haven't gotten the networking stuff done yet. :D I did find some code at developer.apple.com but most of it seems to be a bit more complicated such as finding services automatically.

    Thanks again!
    CG
     

Share This Page