ThePentiumGuy Posted February 22, 2005 Posted February 22, 2005 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 Quote 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
coldfusion244 Posted February 22, 2005 Posted February 22, 2005 TPG, if you aren't using asynchronous methods or threads, then it will stop on that statement and wait until someone does connect. Are you using it and it still stops there? Quote -Sean
ThePentiumGuy Posted February 23, 2005 Author Posted February 23, 2005 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 Quote 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
coldfusion244 Posted February 23, 2005 Posted February 23, 2005 (edited) I'll upload some code (as an edit) to this post later when I am at my work pc. It's the help that I received from HJB on the same toppic. Client.zipFetching info... Edited February 23, 2005 by coldfusion244 Quote -Sean
ThePentiumGuy Posted February 23, 2005 Author Posted February 23, 2005 Quote I'll upload some code (as an edit) to this post later when I am at my work pc. It's the help that I received from HJB on the same toppic. Thanks man. Quote 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
ThePentiumGuy Posted February 25, 2005 Author Posted February 25, 2005 Oh, thanks. I didn't notice the edit. I'll check it out tonight. Quote 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
kcwallace Posted March 2, 2005 Posted March 2, 2005 Is there a VB example for asyncronous connections? Quote Go Beavs!!!
ThePentiumGuy Posted July 28, 2005 Author Posted July 28, 2005 I'd like to bump this thread, because I'm not exactly sure what the code does. Quote 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
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.