Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Nonnus3G

macrumors member
Original poster
Jul 9, 2008
52
0
hello

i am using nsstreams to send data back and forth between my ipnoe app and a desktop app

but so far i only send a fixed amount of dat (packets)

as i am interested in using this mechnism for transfering files i need to be ablt to send an undefined amount of data

i have checked some sample code that seems to use a buffer to write / read data but could not actually complete an implementation yet (prob beacuase i am lazy and i have lot of dif stuff to do so i keep leaving this for later;)

can anyone point me out to a working sample code ?

i also found that most of these samples expect a nsdata object to be able to use [nsdata lenght] method

i have been sending (uint8_t*)packet[3] = {val0, val1, val2} data
(i also used Bytes but could not realy understand the differences as both seemed to work ok)
and i was able to retrieve individual vals with packet[x]
but this way i can never get the lenght of the data
sizeof(packet) always returns 4
is there any other way to get its size ?

or do i need to convert with [NSData dataWithBytes:length:]

with nsdata i extract the individual data with range operation ?

tx alot for your help and attention

nonnus
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.