• 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: [Q] disposing of a stream object when NSStreamEventEndEncounterered is received?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Q] disposing of a stream object when NSStreamEventEndEncounterered is received?


  • Subject: Re: [Q] disposing of a stream object when NSStreamEventEndEncounterered is received?
  • From: Michael Ash <email@hidden>
  • Date: Tue, 27 Jan 2009 17:54:57 -0500

On Tue, Jan 27, 2009 at 2:25 PM, JongAm Park
<email@hidden> wrote:
> Hello.
>
> According to "Stream Programming Guide for Cocoa : Writing to Output
> Streams", it says :
>
> "When an NSOutputStream object concludes writing data to an output stream,
> it sends the delegate a |NSStreamEventEndEncountered| event in a
> |stream:handleEvent:| message. At this point the delegate should dispose of
> the stream object by doing the mirror-opposite of what it did to prepare the
> object. In other words, it should first close the stream object, remove it
> from the run loop, and finally release it."
>
> However, I have a system with which a server send back a notification when a
> client registers that it want to get some notification to the server. For
> the system, a stream or a channel which requested the notification should be
> remained open to get notifications from the server afterwards.
>
> Under this scenario, can't I use the Run-Loop based meachanism? is there any
> way to keep the stream open?

I'm afraid I don't understand your message. What's the actual problem
here? When you receive NSStreamEventEndEncountered it's because the
stream has reached its end and no more data will be forthcoming. With
a network stream, it will occur because the other side (or some
network problem) has closed the stream. You obviously cannot read
server notifications out of a stream after this happens. And none of
this has anything to do with runloops.

Mike
_______________________________________________

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: 
 >[Q] disposing of a stream object when NSStreamEventEndEncounterered is received? (From: JongAm Park <email@hidden>)

  • Prev by Date: Re: Is there a more efficient way to get the first 4 bytes off a NSInputStream to compare
  • Next by Date: Re: CoreData silently failing to insert?
  • Previous by thread: [Q] disposing of a stream object when NSStreamEventEndEncounterered is received?
  • Next by thread: Hillegass: Animation, NSProgressIndicator and Bindings
  • Index(es):
    • Date
    • Thread