Click here to Skip to main content
15,901,666 members
Home / Discussions / C#
   

C#

 
AnswerRe: Setting focus on a control? Pin
MeisterBiber9-Sep-03 4:12
MeisterBiber9-Sep-03 4:12 
GeneralRe: Setting focus on a control? Pin
mcgahanfl9-Sep-03 4:55
mcgahanfl9-Sep-03 4:55 
GeneralRe: Setting focus on a control? Pin
Mazdak9-Sep-03 5:16
Mazdak9-Sep-03 5:16 
GeneralRe: Setting focus on a control? Pin
MeisterBiber9-Sep-03 5:41
MeisterBiber9-Sep-03 5:41 
GeneralRe: Setting focus on a control? Pin
Mazdak9-Sep-03 6:02
Mazdak9-Sep-03 6:02 
Generalhelp Pin
cheeseruler9-Sep-03 3:19
cheeseruler9-Sep-03 3:19 
GeneralRe: help Pin
David Stone9-Sep-03 4:36
sitebuilderDavid Stone9-Sep-03 4:36 
GeneralRe: help Pin
joan_fl9-Sep-03 10:29
joan_fl9-Sep-03 10:29 
GeneralRe: help Pin
cheeseruler10-Sep-03 2:54
cheeseruler10-Sep-03 2:54 
Generalforce datagrid to display "ahead-0" of integer Pin
MeisterBiber9-Sep-03 3:18
MeisterBiber9-Sep-03 3:18 
GeneralRe: force datagrid to display "ahead-0" of integer Pin
Jim Stewart9-Sep-03 3:20
Jim Stewart9-Sep-03 3:20 
GeneralFrames in axWebBrowser control Pin
Andrlage9-Sep-03 1:52
Andrlage9-Sep-03 1:52 
GeneralRe: Frames in axWebBrowser control Pin
Jagadeesh VN9-Sep-03 3:38
Jagadeesh VN9-Sep-03 3:38 
GeneralRe: Frames in axWebBrowser control Pin
Andrlage9-Sep-03 11:54
Andrlage9-Sep-03 11:54 
GeneralRe: Frames in axWebBrowser control Pin
Arun Chembilath30-Apr-11 7:10
Arun Chembilath30-Apr-11 7:10 
GeneralDLL import and parameters Pin
gmar9-Sep-03 0:56
gmar9-Sep-03 0:56 
GeneralRe: DLL import and parameters Pin
Jagadeesh VN9-Sep-03 3:49
Jagadeesh VN9-Sep-03 3:49 
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.

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.