• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: network programming
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: network programming


  • Subject: Re: network programming
  • From: "email@hidden" <email@hidden>
  • Date: Sun, 02 Dec 2012 20:44:47 +0000

On 2 Dec 2012, at 20:30, Jens Alfke <email@hidden> wrote:

>
> On Dec 2, 2012, at 11:29 AM, email@hidden wrote:
>
>> question is, what's the best way to do that? can i use cocoa or do i have to use some lower-level libraries? i think the broker accepts TCP while flightgear expects UDP, AFAIK.
>
> Cocoa has some limited support for TCP: you can open a client connection and send and receive data. For anything beyond that you have to drop down to CFNetwork. Doing a TCP server isn’t too hard because CFStream is toll-free bridged to NSStream, so you can use CFStream to listen for connections and then use NSStream for the I/O. Apple has some sample apps that demonstrate this.
>
> There’s no Cocoa support for UDP; the highest level system API for it is CFSocket, or of course you could just use the POSIX system calls. It’s possible there are 3rd party Obj-C APIs for UDP networking, but I don’t know of any offhand.
In addition to TCP the AsyncSocket project also provides UDP support.
See AsyncUdpSocket and GCDAsyncUdpSocket in https://github.com/robbiehanson/CocoaAsyncSocket

Regards

Jonathan
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >network programming (From: email@hidden)
 >Re: network programming (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: network programming
  • Next by Date: Re: network programming
  • Previous by thread: Re: network programming
  • Next by thread: Re: network programming
  • Index(es):
    • Date
    • Thread