Re: Problem with NSStream newbie question
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