Solved

flush buffer when using internet daemon

Posted on 2001-06-18
3
368 Views
Last Modified: 2010-04-15
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.
0
Comment
Question by:dorinda
  • 2
3 Comments
 

Author Comment

by:dorinda
ID: 6203093
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 */                                                                        
0
 
LVL 1

Accepted Solution

by:
yabelson earned 100 total points
ID: 6204254
you can also try flushall() if you dont mind all of th eother buffers to flush too...  (-:


0
 

Author Comment

by:dorinda
ID: 6227882
The problem turned out to not be the buffer but an overflow on a variable.
0

Featured Post

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now