Re: reading data from a UDP port - questions

2008-03-18 Thread Rob Napier
Your NSLog() is giving unexpected results because you are using %s. This is a cstring (not NSString), which is null-terminated. What you probably mean is this (at least for testing purposes): NSLog (@socketCallback (DMX event). %@ %i bytes, msg, [msg length]); This will print the hex codes

Re: reading data from a UDP port - questions

2008-03-17 Thread Benjamin Stiglitz
(2) But in any case, NSString doesn't mind embedded null bytes. (It's not null-terminated like a C string; the string object remembers the length separately.) That doesn't mean you should store binary data in an NSString, though. NSData is better for that. NSString isn’t really too happy

reading data from a UDP port - questions

2008-03-16 Thread Jason Ellemor
Hi, I have a device which basically outputs a UDP data stream. FYI the protocol specs are at : http://www.enttec.com/docs/enttec_protocol.pdf I found a really helpful post on the forum here titled : Re: Listen on a UDP Port( http://lists.apple.com/archives/cocoa-dev/2008/Feb/