Link to home
Start Free TrialLog in
Avatar of dorinda
dorinda

asked on

flush buffer when using internet daemon

I need to know how to flush the buffer when using internet dameon? I have tried fflush(stdout) but that didn't seem to work.

An example would be appreciated.
Avatar of dorinda
dorinda

ASKER

Here is a sample of the logic I am using.  As you can see I have also tried ioctl(0,FLUSHW)

------------------------------------------------
{                                                                      
    TBuff[0] = START_OF_MSG_CHAR;                                      
                                                                       
    snprintf(buff, sizeof(buff), "%s", START_OF_MSG_CHAR);            
    write(0, TBuff, strlen(TBuff));                                    
    ioctl(0, FLUSHW);                                                  
                                                                       
    //flushq(q, 0);                                                    
    //bdflush();                                                      
                                                                       
    VBPtr = VBPtr + 1;                                                
    VBArray1[VBPtr][0] = END_OF_MSG_CHAR;                              
                                                                       
    for (x = 0; x < VBPtr + 1; x++)                                    
     {                                                                
        if (x < 241)                                                  
         {                                                            
            snprintf(buff, sizeof(VBArray1[x]), "%s", VBArray1[x]);    
            write(0, buff, strlen(buff));                              
            ioctl(0, FLUSHW);                                          
         }                                                            
     }                                                                
                                                                       
 } /* vbsend */                                                                        
ASKER CERTIFIED SOLUTION
Avatar of yabelson
yabelson

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dorinda

ASKER

The problem turned out to not be the buffer but an overflow on a variable.