Professional Web Applications Themes

Cocoa Networking - Mac Programming

I really need some advice here. I am learning the basics of Mac OS X programming and I have learned a great deal on my own. What I have created so far is a program that randomly generates a maze, then using IB I have built an interface to input the size of the maze and then display the maze using quartz. I have implemented threading and many of the different aspects of Cocoa. I am now attempting to add networking to this program. What I have done to learn Networking is write a program that can act as host ...

  1. #1

    Default Cocoa Networking

    I really need some advice here.

    I am learning the basics of Mac OS X programming and I have learned a
    great deal on my own. What I have created so far is a program that
    randomly generates a maze, then using IB I have built an interface to
    input the size of the maze and then display the maze using quartz. I
    have implemented threading and many of the different aspects of Cocoa.
    I am now attempting to add networking to this program.

    What I have done to learn Networking is write a program that can act
    as host or client. I want this program when running as Host to
    broadcast it's service and then wait for someone to try a connection.
    As client I want it to search for services and then using a
    NSTableView that I have already created and set up, display the Hosts
    that have this service and then let the user choose one and push the
    connect button. Once the connection is made I want the users to be
    able to send text back and forth like IM. I have everything set up for
    this but the net service.

    I have heard of many different ways to go about doing this but I have
    not SEEN them. I want to create a program that does not use Rendezvous
    because I want to use TCP so that I can eventually port my program to
    Linux or Window (Please don't kill me I just want to learn) which of I
    am correct on this they do not use Rendezvous. I want each OS to be
    able to communicate with each other.

    I have seen CFSocket and heard of the many Core Foundation services
    but am at a complete loss as how to use them, I cannot #import
    CFSocket because XCode cannot find unless I call its absolute path.
    Even when I call #import <CoreFoundation/CoreFoundation.h> the
    compiler cannot find CFSocket. I get errors.

    What I would like to know is what should I use to do what I want it to
    do? Rendezvous? CFSocket? Something else?

    Where can I find the necessary information on using the answer from
    above?

    If there is no direct info out there can I get a little help just
    creating the basic stuff? I am pretty sure that once I get a socket
    created and the host broadcasting its service I can do the rest. I
    just need a swift kick in the pants to get me started.

    CodeMedic42
    CodeMedic Guest

  2. #2

    Default Re: Cocoa Networking

    In article <google.com>,
    com (CodeMedic) wrote:
     

    You are incorrect:

    - RendezVous is Apple marketing's term for ZeroConf
    <http://www.zeroconf.org>
    - Apple has released the RendezVous source code (under the 'Apple Public
    Source License')
    <http://www.apple.com/pr/library/2002/sep/25rendezvous.html>

    Reinder
    Reinder Guest

  3. #3

    Default Re: Cocoa Networking

    CodeMedic wrote:
     

    I think the "Core Mac OS X and Unix Programming" book will help you a lot here.
    A little pricey, but far better than its original price. It has a good section on networking. You can buy direct from the distributor (I did).

    http://www.bignerdranch.com/Company/Core_Book_PR.html
    http://www.atlasbooks.com/marktplc/00981.htm
     

    I believe Rendezvous is a name service where clients can locate servers.
    Both clients and servers will use sockets (of some form) to talk to the network.
    You get to learn both! :-)

    Good luck!

    Mike Guest

  4. #4

    Default Re: Cocoa Networking

    CodeMedic wrote: 

    you can get what you want of course, but there's a fair amount of
    learning involved.

    you say you want to get this working on more platforms than just macosx.
    that's a strong argument for doing things the berkeley sockets way.
    that means completely ignoring CFSocket, because it is not portable.
    you can do berkeley sockets on pretty much everything, including macosx
    and windows. the "bible" on this topic is "unix network programming,
    network apis: sockets and xti volume 1," by w. richard stevens. it's a
    thick, expensive book, but you can read it little bits at a time.

    if you want to advertise services without using rendezvous, you'll have
    to use broadcast datagrams. for sending text back and forth, you'll
    want to use tcp stream connections.
    Jhnny Guest

Similar Threads

  1. Replies: 0
    Last Post: June 19th, 08:19 AM
  2. Cocoa Browser Help
    By James in forum Mac Programming
    Replies: 3
    Last Post: April 25th, 06:52 PM
  3. C++ in cocoa
    By Robert in forum Mac Programming
    Replies: 6
    Last Post: February 26th, 07:19 PM
  4. Bit shifts in Cocoa
    By Korbin Meiser in forum Mac Programming
    Replies: 2
    Last Post: September 11th, 01:11 AM
  5. Cocoa Networking - Empty Data from Async FileHande Read
    By Tom Cook in forum Mac Programming
    Replies: 0
    Last Post: July 23rd, 01:40 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139