• 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
NSStream, NSInputStream, NSOutputStream
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSStream, NSInputStream, NSOutputStream


  • Subject: NSStream, NSInputStream, NSOutputStream
  • From: John MacMullin <email@hidden>
  • Date: Mon, 19 May 2008 18:07:31 -0700

Continuing on my efforts re: my modified Echo Server, the following code is crashing.

- (void)startStreamWrite:(NSOutputStream *)ostream
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc]init];
	while ([ostream hasSpaceAvailable]) {
		if (remainingToWrite > 0) {
			actuallyWritten = 0;
			actuallyWritten = [ostream write:marker maxLength:1];
			if ((actuallyWritten == -1) || (actuallyWritten == -1)) {
				NSLog(@"[ostream streamError]:\n%@\n", [ostream streamError]);
				NSLog(@"remainingToWrite:\n%u\n", remainingToWrite);
				NSLog(@"ostream:\n%@\n", ostream);
			} else {
				remainingToWrite -= actuallyWritten;
				marker += actuallyWritten;
				NSLog(@"remainingToWrite:\n%u\n", remainingToWrite);
			}
		}
	}
    [pool release];
}

The error returned is: [ostream streamError]:
NSError "POSIX error: Broken pipe" Domain=NSPOSIXErrorDomain Code=32

I have looked at the stream error docs in NSStream and this error is not even reference.

Any ideas on what this means and how I fix it would be greatly appreciated.

John


_______________________________________________

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: NSStream, NSInputStream, NSOutputStream
      • From: Ken Thomases <email@hidden>
    • Re: NSStream, NSInputStream, NSOutputStream
      • From: Michael Vannorsdel <email@hidden>
  • Prev by Date: Re: Newbie Question re Allocation & Initialization
  • Next by Date: Re: Newbie Question re Allocation & Initialization
  • Previous by thread: Re: NSStream, NSInputStream, NSOutputStream
  • Next by thread: Re: NSStream, NSInputStream, NSOutputStream
  • Index(es):
    • Date
    • Thread