.NET Csharp tcp ip app stops working without any error code.
Hi All,
I'm developing a sort of torrent CLI client(for self improvement) and during the tcp/ip download + communication process from peer application just exiting with code 0(i.e. without error).
I put try catch block + UnhandledExceptionEventHandler(https://learn.microsoft.com/en-us/dotnet/api/system.appdomain.unhandledexception?redirectedfrom=MSDN&view=net-7.0) but nothing is caught over there.
I also checked the Event Viewer and debug logs, nothing there as well.
Console output + source code class are attached.
I just need somebody to point me, where can I get any info/logs with the error info, rest fixes are on me 🙂
PS: Code is far not ideal and not finished, but it is working. App usually stops after 20-40 iterations.
AppDomain.UnhandledException Event (System)
Occurs when an exception is not caught.
6 Replies
Have you tried using breakpoints and/or log messages?
- Ah, it reaches this, but not this. So the error must be somewhere above
Of course. It's just stopped and that is it 😦
Buddy#1917
- Ah, it reaches this, but not this. So the error must be somewhere above
Quoted by
<@!203166497198047232> from #.NET Csharp tcp ip app stops working without any error code. (click here)
React with ❌ to remove this embed.
I also put a message Console.WriteLine("FINISH!!!!"); in case if it is going out of the cycle, but it is not.
+ I also added logging screen, so it is inside of cycle which inside of the try/catch so error is not above
the only reason it could not print
FINISH!!!!
is if the condition in line 68 evaluates to true
if u replace the return
with a break
in line 69 u will probably see the log messageLooks like a valid point!
Let me run a quick check
You are right + thank you very much!