Can anyone suggest a book for learning about Networking?

Discussion in 'iOS Programming' started by LastLine, Jul 15, 2010.

  1. LastLine macrumors 65816

    Aug 24, 2005
    Hey everyone,

    I'm trying to find a good way to learn about Bonjour/Zeroconf networking on the iPhone (with an eventual view to linking with a Mac client) however I have little experience with network programming so I'm looking for something that really works from the ground up. I've tried several online tutorials and the like but have yet to find one that a) works, and b) starts from a low enough level.

    Anyone got any ideas?

    EDIT: Needn't be a full book on Networking, just one with a good example or two perhaps?
  2. chown33 macrumors 604

    Aug 9, 2009
    Sailing beyond the sunset
    Post the tutorials that didn't work, so we know what you need a lower level than.

    Also, do you need to understand the APIs, or do you need to understand how the actual network protocols work "on the wire"? For the latter, you can read the RFCs, which cover details very precisely, in as low a level as you care to go.
  3. LastLine thread starter macrumors 65816

    Aug 24, 2005
    Essentially what I need is to be able to setup a simple program that sends a message from iPhone to Mac i.e.

    iPhone sends message "A" and Mac responds with method 'A'

    From a reading point of view I'd like something that allows me to work on a basic level, but also allows me to learn more if I want to...if that makes sense. It's kind of lost me to some extent, I get the general ideas I just don't seem to be able to make it work yet.

    The tutorial I followed is here:

    Now it all runs and the like, discovers services on the Network however as soon as either button is pressed, it crashes - I've attached my working as a file just to show what I've done - perhaps someone can see my errors?

    Any help is very much appreciated, Networking seems something that isn't particularly well catered for with tutorials.

    Attached Files:

  4. xStep macrumors 68000

    Jan 28, 2003
    Less lost in L.A.
    Honestly, it is doubtful anyone is going to debug your code for you. Run it in debug mode and also consider learning how to use Instruments. Also try 'Build and Analyze".

    I haven't found one good source of information on how to do network programming on OS X or iOS. Here are a couple of links that may be helpful.

    Troubleshooting Bonjour Networking for the iPhone

    cocoaasyncsocket: Wrapper for CFSocket and CFStream that may make life easier.

    Bonjour Browser: Allows you to see what is advertising as Bonjour services.

    The Apress book, "iPhone Games Projects" has a chapter titled "Networked Games: Choosing the Right Option" which isn't bad.

    Although you might get something out of the "iPhone Cool Projects" networking chapter, it uses UDP which is a protocol not guaranteed to deliver it's content.

    There are 2 or three WWDC 2010 videos that discuss networking.

    Expect to spend a lot time on your networking code. It is difficult stuff. I used many NSLogs and went so far as doing MD5 checksums on the data I was passing and confirming it on the receiver. You also may have concerns regarding endianness.
  5. LastLine thread starter macrumors 65816

    Aug 24, 2005

Share This Page