Results 1 to 1 of 1

Thread: parsing incoming data

Threaded View

  1. #1

    Thread Starter
    PowerPoster sunburnt's Avatar
    Join Date
    Feb 2001
    Location
    Boulder, Colorado
    Posts
    1,403

    parsing incoming data

    Hullo. I'm writing a simple server which will parse messages and respond to them. Since I do not usually work with c++, I'm looking for a little help
    My protocol is a simple one -- Command\rArgument\rArgument\n (or Command\n) but I'm having trouble parsing it. What I would like to do is set up a buffer which data is put into, and then complete commands are taken out/parsed and any leftover is returned to the buffer. Unfortunantly, I'm not too clear on how to do this :P
    Here's what we're looking at:

    Code:
    char input[256];
    memset(input,0x20, 255);
    input[255] = '\0';
    
    while( sckout != SOCKET_ERROR )
    {
    	lenx = recv( sckout, input, sizeof(input), 0) ;
    		if (lenx > 0)
    		{
    		/* ehhhhh :-D */
    		}
    						
    	}
    }
    any comments/code would be appreciated. Thanks.
    Last edited by sunburnt; May 15th, 2002 at 03:52 PM.
    Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width