C
C#2y ago
roland7757

.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
Buddy
Buddy2y ago
Have you tried using breakpoints and/or log messages? - Ah, it reaches this, but not this. So the error must be somewhere above
roland7757
roland7757OP2y ago
Of course. It's just stopped and that is it 😦
MODiX
MODiX2y ago
Buddy#1917
- Ah, it reaches this, but not this. So the error must be somewhere above
React with ❌ to remove this embed.
roland7757
roland7757OP2y ago
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
cap5lut
cap5lut2y ago
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 message
roland7757
roland7757OP2y ago
Looks like a valid point! Let me run a quick check You are right + thank you very much!
Want results from more Discord servers?
Add your server