• 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: TCP/IP Connections
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TCP/IP Connections


  • Subject: Re: TCP/IP Connections
  • From: Chris Parker <email@hidden>
  • Date: Sat, 22 Dec 2001 23:45:00 -0800

Hi Sander,

On Saturday, December 22, 2001, at 07:00 AM, email@hidden wrote:

* Bugger all and write my own classes using the BSD layer
I hope it won't have to come to that, but I could also write my own classes (much the way OMNI did) using POSIX and make it asynchronous by using an NSTimer.

* Any other???

You may wish to look at NSFileHandle. Although you'd have to create the network socket in the traditional manner, you can create an NSFileHandle from the file descriptor resulting from that by using initWithFileDescriptor:closeOnDealloc:

Once you've got that set up you can add another object as an observer of the NSFileHandleReadCompletionNotification which will tell you when you get data on the socket.

Once you've got that set up, you can use readInBackgroundAndNotify: in order to have it read in the background and issue the notification above.

.chris

--
Chris Parker
Cocoa Frameworks Engineer
Apple Computer, Inc.


  • Follow-Ups:
    • Re: TCP/IP Connections
      • From: email@hidden
    • Re: TCP/IP Connections
      • From: email@hidden
References: 
 >TCP/IP Connections (From: email@hidden)

  • Prev by Date: Re: Saving/Opening Files - different under PB than with build of app
  • Next by Date: Re: precomputing alpha + color accuracy ?
  • Previous by thread: Re: TCP/IP Connections
  • Next by thread: Re: TCP/IP Connections
  • Index(es):
    • Date
    • Thread