C# NetworkStream


  • Hey, I'm working on an IRC client, and when I debug, it freezes on
    textBox3.Text += Environment.NewLine + fr0styReader.ReadLine();

    It throws no exceptions, yet in the debugger I see "BaseStream = Cannot evaluate expression because a native frame is on top of the call stack."

    I tried wrapping it in a try-catch, but what good would that do if it throws no exceptions? Also, I tried if (fr0styReader.ReadLine() != null) { before the textBox3.Text += statement. If you need more info, please let me know, this has been driving me insane >.<

    • Moved by eryang Thursday, November 04, 2010 6:21 AM Move to .NET Networking forum for better support. (From:Visual Studio Debugger)
    Wednesday, November 03, 2010 12:09 AM

All replies

  • No one has any ideas? :[
    Wednesday, November 03, 2010 9:45 PM
  • Sounds like you're not getting a response, or at least not a full line worth of data.  Try using netmon to see what's happening on the wire.
    Friday, November 05, 2010 1:30 PM
  • Well i've gathered that much, i can see that its not recieving data because in the error details, i see the current value for the net stream is null, but how would i stop it from processing null data? Like i said, it doesn't throw an exception, so i can't use a try-catch, or even an if statement. I'm at a complete loss. Lol :b
    Monday, November 08, 2010 6:37 AM
  • 1. The error in the debugger is *only* an error with the debugger.  The *debugger* can't display the variable.  That's all, no other problem.  No problem in the program.

    2. So, ReadLine is not completing.  Why?  Because there's no *line* to read, it would seem.  It can't contain a newline nor a carriage-return.

    There are two ways forward.

    a) Debug what you *are* receiving from the other end.  You either need to use a network sniffer device or application, or convert that line into a loop that reads one character (or string) at a time in a loop and see what the other end is sending.  Or for sniffing, you can use http://blogs.technet.com/b/netmon/ or use .NET network diagnostics, http://msdn.microsoft.com/en-us/library/ty48b824.aspx

    http://www.alanjmcf.me.uk/ Please follow-up in the newsgroup. If I help, mark the question answered
    Wednesday, November 10, 2010 1:52 PM