• 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
Parsing a packet Async Socket
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Parsing a packet Async Socket
      • From: Agent M <email@hidden>
  • Prev by Date: Re: unreliability of NSWorkspace selectFile
  • Next by Date: progress bar while creating a file
  • Previous by thread: NSDateFormatter subclass not created when nib loads
  • Next by thread: Re: Parsing a packet Async Socket
  • Index(es):
    • Date
    • Thread