Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
GeneralDragDrop registration failed Pin
Nick Seng8-Sep-03 18:24
Nick Seng8-Sep-03 18:24 
Generalusing activex/com listeners (callbacks) Pin
olivier.fillon@csiro.au8-Sep-03 15:47
olivier.fillon@csiro.au8-Sep-03 15:47 
GeneralRe: I have problem to drop image files to PictureBox control... Pin
Nick Parker8-Sep-03 15:38
protectorNick Parker8-Sep-03 15:38 
GeneralRe: I have problem to drop image files to PictureBox control... Pin
Donald_a9-Sep-03 3:36
Donald_a9-Sep-03 3:36 
GeneralStatus Bar with Custom Panels Pin
Clarke768-Sep-03 14:12
Clarke768-Sep-03 14:12 
GeneralGet window content as bitmap Pin
sumeat8-Sep-03 14:10
sumeat8-Sep-03 14:10 
GeneralRe: Get window content as bitmap Pin
azusakt8-Sep-03 15:36
azusakt8-Sep-03 15:36 
Generaltcpclient stream read Pin
mikemilano8-Sep-03 13:12
mikemilano8-Sep-03 13:12 
i'm working on a server/client app and i'm running into problems.

i would like the client to update when the server sends data to it.

the problem is with Stream.Read() . This method will hang the application until either data is received, or an exception is generated.

is there a way to check if data exists before you call the read method?

this is a snippet of the code i'm using:
TcpClient tcpclnt = new TcpClient();         
tcpclnt.Connect("10.10.10.10',8001);
Stream stm = tcpclnt.GetStream();
....

listen()
{
  try
  {
    byte[] bb = new byte[100];
    int k = stm.Read(bb,0,100);

    for ( int i=0 ; i<k ; i++ )
      txtBox.Text += (Convert.ToChar(bb[i]));	
  }
  catch(Exception p)
  {
    MessageBox.Show(p.ToString());
  }
}


when i call the listen method, the entire app just freezes while it waites for data.
GeneralRe: tcpclient stream read Pin
leppie8-Sep-03 16:05
leppie8-Sep-03 16:05 
GeneralRe: tcpclient stream read Pin
leppie8-Sep-03 16:05
leppie8-Sep-03 16:05 
GeneralRe: tcpclient stream read Pin
Nick Parker8-Sep-03 16:25
protectorNick Parker8-Sep-03 16:25 
GeneralRe: tcpclient stream read Pin
TimK8-Sep-03 16:19
TimK8-Sep-03 16:19 
GeneralExtand and access the internat Microsoft Office object structure Pin
gicio8-Sep-03 9:47
gicio8-Sep-03 9:47 
GeneralJust a detailed question Pin
jphuphilly8-Sep-03 9:28
jphuphilly8-Sep-03 9:28 
GeneralRe: Just a detailed question Pin
leppie8-Sep-03 10:50
leppie8-Sep-03 10:50 
Questionwhat is the difference between [,] &amp; [][]? Pin
yyf8-Sep-03 8:32
yyf8-Sep-03 8:32 
AnswerRe: what is the difference between [,] &amp; [][]? Pin
David Stone8-Sep-03 9:06
sitebuilderDavid Stone8-Sep-03 9:06 
GeneralRe: what is the difference between [,] &amp; [][]? Pin
Anonymous12-Sep-03 6:09
Anonymous12-Sep-03 6:09 
QuestionHow to realloc? Pin
yyf8-Sep-03 8:30
yyf8-Sep-03 8:30 
AnswerRe: How to realloc? Pin
Daniel Turini8-Sep-03 9:18
Daniel Turini8-Sep-03 9:18 
AnswerRe: How to realloc? Pin
Nemanja Trifunovic8-Sep-03 9:30
Nemanja Trifunovic8-Sep-03 9:30 
Generaliterating controls on the form Pin
mcgahanfl8-Sep-03 5:05
mcgahanfl8-Sep-03 5:05 
GeneralRe: iterating controls on the form Pin
Donald_a8-Sep-03 5:12
Donald_a8-Sep-03 5:12 
GeneralRe: iterating controls on the form Pin
Corinna John8-Sep-03 7:25
Corinna John8-Sep-03 7:25 
GeneralRe: iterating controls on the form Pin
Donald_a8-Sep-03 21:59
Donald_a8-Sep-03 21:59 

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.