| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Hey all,[snipped]
So I've got a socket problem. Actually it's not so much a socket problem as it is an NSData problem.
I'm working on an app where (unfortunately) the networking protocols are already written/being used...
All communication (in existing versions) is handled by directly writing characters to the socket, as in:
send (socketfd, &charbuf, length, 0);
recv (socketfd, &charbuf, length, 0);
Where the character buffers are regular (unterminated) C strings. For a new-line delimeter, it uses unsigned char 0xFF (int 255).
Here's the problem... I've tried OmniNetworking, SmallSockets, and now AsyncSockets (which I like best because it supports delegation exactly the way I would implement it myself); they all offer the same problem, text encoding.
Since all data sent to/received from the server in these classes is encapsulated inside an NSData object, I can't simply reference characters directly as I would if I was using the above (raw) socket functions. I've tried using:
| References: | |
| >NSData encoding issues... (From: Alex Lock <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.