NSStream, NSInputStream, NSOutputStream
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