Thread: recv large amounts of data

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Aug 2008
    Posts
    67

    recv large amounts of data

    I'm writing a chat bot for PvPGN BnetD. The format will look similar to this:

    1010 NAME kpreston
    1018 INFO "Welcome to PvPGN BnetD 1.5.0!"
    1018 INFO "Type /help for a list of commands."
    1002 JOIN kpreston 0001
    1003 LEAVE somedude 0001
    1003 LEAVE somedude(1) 0001
    1002 JOIN somedude(2) 0001
    1003 LEAVE somedude(2) 0001
    The server is restarted every 3-5 hours. When this happens, approx. 1000 users/bots will reconnect. The issue I'm having is when recv() returns this:

    1010 NAME kpreston\r\n
    1018 INFO "Welcome to PvPGN BnetD 1.5.0!"\r\n
    1018 INFO "Type /help for a list of commands."\r\n
    1002 JOIN kpreston 0001\r\n
    1003 LEAVE somedude 0001\r\n
    1003 LEAVE somedude(1) 0001\r\n
    1002 JOIN somedu
    The buffer gets parsed by "\r\n," and I have an incomplete packet at the end, which will cause undefined behaivor if I don't have a ton of error checking.

    How would you solve this?

    Edit: Speed and efficiency is the MOST important aspect to consider.
    Last edited by kpreston; 10-16-2008 at 12:12 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. xor linked list
    By adramalech in forum C Programming
    Replies: 23
    Last Post: 10-14-2008, 10:13 AM
  2. Large Data management in using File
    By mohsan1987 in forum C Programming
    Replies: 6
    Last Post: 09-14-2006, 06:41 AM
  3. Reading large complicated data files
    By dodzy in forum C Programming
    Replies: 16
    Last Post: 05-17-2006, 04:57 PM
  4. gcc problem
    By bjdea1 in forum Linux Programming
    Replies: 13
    Last Post: 04-29-2002, 06:51 PM
  5. accepting large amounts of data
    By Sekti in forum C++ Programming
    Replies: 1
    Last Post: 04-05-2002, 05:45 PM