Click here to Skip to main content
16,005,473 members
Home / Discussions / C#
   

C#

 
GeneralApp.Config Question... Pin
Richard Parsons7-Jan-05 8:24
Richard Parsons7-Jan-05 8:24 
GeneralRe: App.Config Question... Pin
Nick Parker7-Jan-05 8:38
protectorNick Parker7-Jan-05 8:38 
GeneralRe: App.Config Question... Pin
Richard Parsons7-Jan-05 9:12
Richard Parsons7-Jan-05 9:12 
QuestionHow can I make the datagrid invisible and have the save button come up Pin
macupryk7-Jan-05 8:10
macupryk7-Jan-05 8:10 
AnswerRe: How can I make the datagrid invisible and have the save button come up Pin
Nick Parker7-Jan-05 8:30
protectorNick Parker7-Jan-05 8:30 
GeneralBeginRead() EndRead() methods with NetworkStream class Pin
mikeyhardingboyo7-Jan-05 6:53
mikeyhardingboyo7-Jan-05 6:53 
GeneralRe: BeginRead() EndRead() methods with NetworkStream class Pin
Heath Stewart7-Jan-05 7:38
protectorHeath Stewart7-Jan-05 7:38 
GeneralRe: BeginRead() EndRead() methods with NetworkStream class Pin
mikeyhardingboyo7-Jan-05 8:04
mikeyhardingboyo7-Jan-05 8:04 
I do use the DataAvailable property. My point is that when i initially call BeginRead() from my main thread, there is always data to read....thus is returns and allows the main thread to continue....

Thus in the seperate thread that the initial BeginRead call created I want it to block in that thread if there is no data to read, until data becomes available.....

Thus I have to have a form of iteration where the BeginRead() is called in the seperate thread so it can continue to check for data as long as the program is running.

As the seperate thread is executed i do call the EndRead() on each result of a BeginRead() call.

The method that the seperate thread executes looks like this...so are you telling me this is not possible?

public void myReadCallBack(IAsyncResult result)
{

NetworkStream str = (NetworkStream) result.AsyncState;
byte[] myReadBuffer = new byte[2048];
int numberOfBytesRead = 0;

numberOfBytesRead = str.EndRead(result);

myCompleteMessage = String.Concat(myCompleteMessage, Encoding.ASCII.GetString(myReadBuffer, 0, numberOfBytesRead));

TokenizeCommands(myCompleteMessage);
myCompleteMessage = "";

stream.BeginRead(myReadBuffer, 0, myReadBuffer.Length, new AsyncCallback(myReadCallBack),stream);

}

mike
GeneralRe: BeginRead() EndRead() methods with NetworkStream class Pin
Heath Stewart7-Jan-05 9:15
protectorHeath Stewart7-Jan-05 9:15 
GeneralRe: BeginRead() EndRead() methods with NetworkStream class Pin
mikeyhardingboyo7-Jan-05 17:19
mikeyhardingboyo7-Jan-05 17:19 
GeneralRe: Strange Pin
bouli7-Jan-05 6:52
bouli7-Jan-05 6:52 
GeneralRe: Strange Pin
Heath Stewart7-Jan-05 7:52
protectorHeath Stewart7-Jan-05 7:52 
GeneralRe: Strange Pin
bouli7-Jan-05 8:54
bouli7-Jan-05 8:54 
GeneralRe: Strange Pin
Heath Stewart7-Jan-05 9:03
protectorHeath Stewart7-Jan-05 9:03 
GeneralRe: Strange Pin
bouli7-Jan-05 9:10
bouli7-Jan-05 9:10 
GeneralStrange Pin
bouli7-Jan-05 6:30
bouli7-Jan-05 6:30 
GeneralRe: Strange Pin
Heath Stewart7-Jan-05 6:44
protectorHeath Stewart7-Jan-05 6:44 
GeneralRe: Strange Pin
bouli7-Jan-05 6:47
bouli7-Jan-05 6:47 
Generaldate time control Pin
Anonymous7-Jan-05 5:35
Anonymous7-Jan-05 5:35 
GeneralRe: date time control Pin
Heath Stewart7-Jan-05 6:42
protectorHeath Stewart7-Jan-05 6:42 
GeneralRe: date time control Pin
Anonymous7-Jan-05 7:18
Anonymous7-Jan-05 7:18 
GeneralRe: date time control Pin
Heath Stewart7-Jan-05 7:33
protectorHeath Stewart7-Jan-05 7:33 
GeneralUdp. How to recieve. Pin
Umair Ahmad khan7-Jan-05 5:05
Umair Ahmad khan7-Jan-05 5:05 
GeneralRe: Udp. How to recieve. Pin
Heath Stewart7-Jan-05 6:34
protectorHeath Stewart7-Jan-05 6:34 
GeneralDoubts in Arabic Part of Work Pin
ChandruIT7-Jan-05 4:34
ChandruIT7-Jan-05 4:34 

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.