• 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: NSHost and NSOutputStream question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSHost and NSOutputStream question


  • Subject: Re: NSHost and NSOutputStream question
  • From: Frederick Cheung <email@hidden>
  • Date: Wed, 25 May 2005 15:33:19 +0100



On 25 May 2005, at 14:25, Luca Re Garbagnati wrote:


Hi all,
I am working on a socket connections software, developed using NSInputStream and NSOutputStream using OS X 10.3.9.
NSHost question:
when I try to get the host handle with [NSHost hostWithName:serverHostName], rather often I get a spinning wheel cursor for about 2-3 seconds, like it is stuck, then it goes on and the host is correctly returned. Is there a way to avoid the spinning cursor? Is it a locking call?
NSOutputStream question:
I just upgraded to Tiger yesterday evening, updated it to 10.4.1, and recompiled my software; tried it out and now I get the spinning wheel cursor even when I do [outputStream write:[messageData bytes] maxLength:[messageData length]];
Please notice I didn't get any spinning cursor on this kind of call using OS X 10.3.9.
Has there been any modification to the socket calls under Tiger? Is there a way to avoid the spinning cursor?
If you need that particular snippet of code please let me know
Thanks in advance for your help.


I have seen a similar problem with CFWriteStreams (which are bridged with NSOutputStream, so what I found may be relevant to you). In my case it was the writing to the stream from the read stream's callback (ie delegate in cocoa-land) that would cause the write operation to block for a long time and then time out. I was able to circumvent this by setting up the write stream for asynchronous use, and not calling write at all unless the stream was ready to accept bytes.

Fred
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSHost and NSOutputStream question (From: Luca Re Garbagnati <email@hidden>)

  • Prev by Date: Re: setNeedsDisplay broken in Tiger
  • Next by Date: Re: Grouping undo-able actions with CoreData
  • Previous by thread: NSHost and NSOutputStream question
  • Next by thread: Bindings between different controllers question...
  • Index(es):
    • Date
    • Thread