• 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: NSFileHandle throws funky exceptions when writing \n to socket
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • RESOLVED - Re: NSFileHandle throws funky exceptions when writing \n to socket
      • From: Tom Jakubowski <email@hidden>
References: 
 >NSFileHandle throws funky exceptions when writing \n to socket (From: Tom Jakubowski <email@hidden>)

  • Prev by Date: NSFileHandle throws funky exceptions when writing \n to socket
  • Next by Date: RESOLVED - Re: NSFileHandle throws funky exceptions when writing \n to socket
  • Previous by thread: NSFileHandle throws funky exceptions when writing \n to socket
  • Next by thread: RESOLVED - Re: NSFileHandle throws funky exceptions when writing \n to socket
  • Index(es):
    • Date
    • Thread