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

Problem with NSStream newbie question


  • Subject: Problem with NSStream newbie question
  • From: "Sebastian Pape" <email@hidden>
  • Date: Wed, 20 Feb 2008 16:44:00 +0100

Hi,
I've been working for two days on one problem now. I want to exchange data
with a server using NSStream. Each call is just 10 lines, with a short
answer of 4 lines.
See what I created so far: http://pastebin.org/20409
I have a main class called AtMain.m and a class for doing the work called
AtStream. I create an object of type AtStream and try to open the
NSInputStream and NSOutputStream, which I can do.

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?

Maybe I am doing everything wrong right now, but I'm a little bit tired of
my examples from "Learning Cocoa with Objective-C" and wanted to start off
with some really easy project, what I thought this would be.

It's all here. Would be really nice if anybody of you could have a look at
it. http://pastebin.org/20409

Thanks
Sebastian.
_______________________________________________

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

  • Follow-Ups:
    • Re: Problem with NSStream newbie question
      • From: Benjamin Stiglitz <email@hidden>
  • Prev by Date: Re: -saveDocument: and package problems
  • Next by Date: Re: NSStringFromClass versus className ?
  • Previous by thread: Re: Problems with CAConstraint
  • Next by thread: Re: Problem with NSStream newbie question
  • Index(es):
    • Date
    • Thread