Re: NSStream, NSInputStream, NSOutputStream
Re: NSStream, NSInputStream, NSOutputStream
- Subject: Re: NSStream, NSInputStream, NSOutputStream
- From: Michael Vannorsdel <email@hidden>
- Date: Mon, 19 May 2008 19:27:13 -0600
How are you creating the stream?
On May 19, 2008, at 7:07 PM, John MacMullin wrote:
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.
_______________________________________________
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