Solved

flush buffer when using internet daemon

Posted on 2001-06-18
3
345 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
Comment Utility
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
Comment Utility
you can also try flushall() if you dont mind all of th eother buffers to flush too...  (-:


0
 

Author Comment

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

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How to setup iphone app subscription service 3 99
jquery/ajax to code behind 7 156
Problem with MFCApp 78 314
How to organize data in excel ? 2 106
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…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
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.

762 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

11 Experts available now in Live!

Get 1:1 Help Now