Parsing a packet Async Socket
Parsing a packet Async Socket
- Subject: Parsing a packet Async Socket
- From: Andrea Salomoni <email@hidden>
- Date: Sat, 4 Mar 2006 14:44:36 +0100
Hi to all,
I'm trying to use Async Sockets to parse a packet returned from a
server.
My packet is divided into a packet header that contains a payload
length and a command.
How can I parse it?
I have something like this:
-(void)sendKeepAlive
{
char buff[20];
buff[0] = 17;
buff[1] = 0;
buff[2] = 10;
int i;
for (i=3; i<20; i++)
{
buff[i] = 0;
}
NSMutableData * keepAliveData = [[NSMutableData alloc]init];
[keepAliveData appendBytes:buff length:20];
[self writeOnServer:keepAliveData];
}
This is an header example .... If I use [socket
readDataWithTimeOut:-1 tag:1]; what kind of data is returned?
Thank you all for any kind of help
Andrea
_______________________________________________
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