Click here to Skip to main content
15,881,413 members
Home / Discussions / C#
   

C#

 
GeneralRe: A simple one to answer Pin
Barry Lapthorn5-Oct-02 12:47
protectorBarry Lapthorn5-Oct-02 12:47 
GeneralRe: A simple one to answer Pin
leppie5-Oct-02 13:54
leppie5-Oct-02 13:54 
GeneralRe: A simple one to answer Pin
leppie5-Oct-02 11:28
leppie5-Oct-02 11:28 
GeneralRe: A simple one to answer Pin
Barry Lapthorn5-Oct-02 12:26
protectorBarry Lapthorn5-Oct-02 12:26 
GeneralMicrosoft Installer Pin
Alex Korchemniy5-Oct-02 6:30
Alex Korchemniy5-Oct-02 6:30 
GeneralRe: Microsoft Installer Pin
Alex Korchemniy5-Oct-02 13:28
Alex Korchemniy5-Oct-02 13:28 
GeneralRe: Microsoft Installer Pin
David Stone6-Oct-02 11:53
sitebuilderDavid Stone6-Oct-02 11:53 
QuestionAsynchronous Streams? Pin
ez25-Oct-02 6:19
ez25-Oct-02 6:19 
I've been playing with asynchronous streams and have a question. When I use the beginRead method for asynchronous reading, the for loop in the code below never gets called until the entire file(fairly large) is completely read(ie. mutiple begin reads and callbacks). I thought that the code should process the for loop while doing some reading of the file and when the read completes right it to the screen. This continues until the entire file is read thereby alternating the output from the for loop and the reading of the file. This is not occuring for me. Is there something I'm missing? I've tried this numerous times using different types of streams and the same thing occurs. Code snippet below:


FileStream inputStream; // inputStream is a filestream

public void Run()
{
inputStream.BeginRead(buffer,0,buffer.Length,new AsyncCallback(this.Callback),null);

for(long i = 0; i <500000; i++)
{
if(i%10000 ==0)
Console.WriteLine(i.ToString());
}
}

public void Callback(IAsyncResult ar)
{
int bytesRead = inputStream.EndRead(ar);
// write output to screen
}
GeneralNon Rectanglular forms Pin
Nnamdi Onyeyiri5-Oct-02 4:31
Nnamdi Onyeyiri5-Oct-02 4:31 
GeneralRe: Non Rectanglular forms Pin
Furty5-Oct-02 4:45
Furty5-Oct-02 4:45 
GeneralRe: Non Rectanglular forms Pin
Nnamdi Onyeyiri5-Oct-02 4:54
Nnamdi Onyeyiri5-Oct-02 4:54 
GeneralRe: Non Rectanglular forms Pin
David Stone5-Oct-02 14:10
sitebuilderDavid Stone5-Oct-02 14:10 
GeneralRe: Non Rectanglular forms Pin
Nnamdi Onyeyiri5-Oct-02 23:29
Nnamdi Onyeyiri5-Oct-02 23:29 
GeneralRe: Non Rectanglular forms Pin
David Stone6-Oct-02 11:45
sitebuilderDavid Stone6-Oct-02 11:45 
GeneralRe: Non Rectanglular forms Pin
Nnamdi Onyeyiri6-Oct-02 20:12
Nnamdi Onyeyiri6-Oct-02 20:12 
QuestionA problem with some GDI+ example? How to avoid it? Pin
Zibar4-Oct-02 21:09
sussZibar4-Oct-02 21:09 
AnswerRe: A problem with some GDI+ example? How to avoid it? Pin
Nick Parker5-Oct-02 1:59
protectorNick Parker5-Oct-02 1:59 
GeneralDirectorySearcher Pin
WizardOfPeyton4-Oct-02 15:37
WizardOfPeyton4-Oct-02 15:37 
GeneralRe: DirectorySearcher Pin
Mazdak5-Oct-02 9:20
Mazdak5-Oct-02 9:20 
GeneralQuestion about drag and drop Pin
Wjousts4-Oct-02 15:36
Wjousts4-Oct-02 15:36 
Questionwindows services ? Pin
imran_rafique4-Oct-02 15:12
imran_rafique4-Oct-02 15:12 
AnswerRe: windows services ? Pin
Paul Riley4-Oct-02 23:35
Paul Riley4-Oct-02 23:35 
GeneralRe: windows services ? Pin
David Stone5-Oct-02 12:49
sitebuilderDavid Stone5-Oct-02 12:49 
AnswerRe: windows services ? Pin
Alex Korchemniy5-Oct-02 6:35
Alex Korchemniy5-Oct-02 6:35 
AnswerRe: windows services ? Pin
jparsons5-Oct-02 18:20
jparsons5-Oct-02 18:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.