• 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: Odd DO Problem...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Odd DO Problem...


  • Subject: Re: Odd DO Problem...
  • From: Dave Keck <email@hidden>
  • Date: Sun, 25 Jan 2004 10:09:25 -0500

I'm writing a client/server that uses distributed objects and works
over TCP. I'm using unsigned char arrays to send data (specifically,
images), but I've run into a nasty problem.

Whenever there's a byte that's assigned 0 in the unsigned char array,
the DO system thinks that's the end of the unsigned char array, causing
all the data after the 0 to be gibberish. One way I've thought of
getting around this problem is setting all the 0's to 1's and then
sending another array telling what indexes need to be changed from 1 to
0. This would allow the data to be sent to the client, and the client
would change all the necessary 1's to 0's.

Although this would probably work, it would cause the application to
slow down, and it seems like a fairly large work-around.

Is there another/a better way of sending data, that will accept 0's? I
tried encapsulating the data into an NSData object awhile back, but I
don't remember it working...

Why not sending an NSArray containing NSNumbers?

I'm really looking for optimum speed, and the NSArray would have to have 200000+ elements. I think using an unsigned char is probably the fastest method if I could get it to work. But nonetheless I will try using an NSArray.

Thanks,

Dave
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Odd DO Problem...
      • From: Chris Kane <email@hidden>
References: 
 >Re: Odd DO Problem... (From: Laurent Daudelin <email@hidden>)

  • Prev by Date: Example Project Cocoa-MySQL
  • Next by Date: Re: NSMovie to/from NSData
  • Previous by thread: Re: Odd DO Problem...
  • Next by thread: Re: Odd DO Problem...
  • Index(es):
    • Date
    • Thread