Re: NSFileHandle throws funky exceptions when writing \n to socket
Re: NSFileHandle throws funky exceptions when writing \n to socket
- Subject: Re: NSFileHandle throws funky exceptions when writing \n to socket
- From: Tom Jakubowski <email@hidden>
- Date: Sun, 26 Jun 2005 06:08:56 -0500
On 6/26/05, Tom Jakubowski <email@hidden> wrote:
> stuff
Upon further review (in gdb), it seems to pass calling writeData:
without a hitch, so the issue must not be with writeData: itself.
Here's the method that I have registered with the notification center
for NSFileHandleReadCompletionNotification.
- (void)receiveData:(NSNotification *)note
{
NSNotificationCenter *nc;
NSString *message;
NSDictionary *noteInfo;
NSData *messageData = [[note userInfo]
objectForKey:NSFileHandleNotificationDataItem];
if ([messageData length] == 0) {
[fileHandle readInBackgroundAndNotify];
return;
}
message = [NSString stringWithUTF8String:[messageData bytes]];
noteInfo = [NSDictionary dictionaryWithObject:message
forKey:@"stringReceived"];
nc = [NSNotificationCenter defaultCenter];
[nc postNotificationName:@"PMCDataReceived"
object:self
userInfo:noteInfo];
[fileHandle readInBackgroundAndNotify];
}
I guess I'll fool around in the debugger some more; I've never really
had to use it before, so this whole thing has been kind of a learning
experience :)
_______________________________________________
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