• 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: Problem with NSStream newbie question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with NSStream newbie question


  • Subject: Re: Problem with NSStream newbie question
  • From: Benjamin Stiglitz <email@hidden>
  • Date: Wed, 20 Feb 2008 09:39:19 -0800

But it seems as if my

- (void)stream:(NSStream *)aStream handleEvent: (NSStreamEvent)eventCode {

method in (AtStream.m) is never triggered by an event. How can I make my
streams stay open and wait to be ready and then write something in there and
receive an answer? It seems as if there wasn't any connection from my little
tool to the server. (tcpdump shows no output). Do I have to init the object
in another way to put it into a kind of "waiting" state?

From the Stream Programming Guide for Cocoa [1]:

“ Because the stream objects you receive back from getStreamsToHost:port:inputStream:outputStream: are autoreleased, be sure to retain them right away.”

You’re probably losing the streams before the run loop gets a chance to run again.

-Ben

[1] http://developer.apple.com/documentation/Cocoa/Conceptual/Streams/Articles/NetworkStreams.html#/ /apple_ref/doc/uid/20002277-1002597_______________________________________________

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: 
 >Problem with NSStream newbie question (From: "Sebastian Pape" <email@hidden>)

  • Prev by Date: Re: DO in all run loop mode
  • Next by Date: Re: UPDATE: Core Data Cascade delete rule sometimes doesn't -- maybe never? (all of a sudden)
  • Previous by thread: Problem with NSStream newbie question
  • Next by thread: DO in all run loop mode
  • Index(es):
    • Date
    • Thread