Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hey guys,

When I read from a stream (TCPClient.GetStream) using StreamReader.ReadLine, it (obviously) waits until it receives some text and then it continues.

 

Is there any way to do something like:

Streamreader.ReadLineButStopIfTheresNothingToRead ?

 

My chat program is going really well, just the server seems to hang on this line, and I can't really... do anything else (ex: AddUserWhenTheyConnect()).

 

-The Pentium Guy

My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!)

vbprogramming.8k.com

My Project (Need VB.NET Programmers)

http://workspaces.gotdotnet.com/ResolutionRPG

Posted

I dont know what asynchronous means, but all I know is that I do not wish for it to stop there, I just want to make it so that when the server receives a message - it'll process it, and franky I don't know where to start :P, besides checking in an infinate loop whether the message it received was blank or not (it becomes blank anways unless it receives a message, because that ReadLine line runs in its own thread... whch seems to confuse me becuase if it's running in its own thread then why is it not going to the AddClient sub?)

 

-The Pentium Guy

My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!)

vbprogramming.8k.com

My Project (Need VB.NET Programmers)

http://workspaces.gotdotnet.com/ResolutionRPG

  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...