Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 04:52

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



C# Listen code trouble in BeginInvoke

Discussion on C# Listen code trouble in BeginInvoke within the .NET Languages forum part of the Coders Den category.

Closed Thread
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2008
Posts: 46
Received Thanks: 5
C# Listen code trouble in BeginInvoke

Closed this
leandro5 is offline  
Old 07/19/2020, 22:36   #2
 
Mikesch01's Avatar
 
elite*gold: 203
Join Date: Sep 2007
Posts: 732
Received Thanks: 190
This code has so many flaws.

- Never run logic in a catch
- NEVER RUN ASNYC CODE IN A CATCH
- Never let a catch empty
- Use while instead of goto-loops
- Remove unnecessary code

- Use english as your coding language
- Use SOLID principle
- Use clean code

This code is unreadable.
Mikesch01 is offline  
Thanks
1 User
Old 07/22/2020, 17:05   #3
 
elite*gold: 0
Join Date: Jan 2008
Posts: 46
Received Thanks: 5
Quote:
Originally Posted by Mikesch01 View Post
This code has so many flaws.

- Never run logic in a catch
- NEVER RUN ASNYC CODE IN A CATCH
- Never let a catch empty
- Use while instead of goto-loops
- Remove unnecessary code

- Use english as your coding language
- Use SOLID principle
- Use clean code

This code is unreadable.
Thanks for the feedback and seems i found where was the problemwas calling endinvoke inside ProcederAceitar i just changed it and now call it's after result where begininvoke is called:

Code:
                if (OnAceitar != null)
                {
                    IAsyncResult result;
                    Console.WriteLine("OnAceitar != null client: {0} Handle: {1}", handler.RemoteEndPoint, handler.Handle);
                    result = OnAceitar.BeginInvoke(client, new AsyncCallback(ProcederAceitar), client);
                    OnAceitar.EndInvoke(result);
                    Console.WriteLine("iAsyncResult OnAceitar.BeginInvoke: " + result.AsyncState);
                }
Code:
        private void ProcederAceitar(IAsyncResult ar)
        {
            if (Fexando)
            {
                Console.WriteLine("ProcederAceitar Fexando igual a true");
                return;
            }

            //OnAceitar.EndInvoke(ar);
leandro5 is offline  
Old 09/29/2021, 06:44   #4

 
elite*gold: 0
Join Date: Nov 2018
Posts: 178
Received Thanks: 48
Quote:
Originally Posted by Mikesch01 View Post
- Never let a catch empty
I gotta disagree with you here, especially when handling procedures that will always throw off an error and you simply want to catch it and nothing more

E.g. attempting a ParseFloat inside of a try catch statement, inside of a boolean.

If you know what the exception is, you know it's not harmful and that it's not just floating around in memory, then what harm can this really do? Nothing and it is common practice for professional coders to
catch(Exception e){}//and thats all
Because why handle something that need not be handled?

So I disagree on this key point here
Keep in mind I didn't see the code posted
tehpwnerer69 is offline  
Closed Thread


Similar Threads Similar Threads
[Selling] [CODE][/CODE][BATTLE]-✅ESP,GLOW,NO-RECOIL,FLY,TP,SILENT - AIM - IN TEST✅[CODE][/CODE]
07/21/2019 - Rainbow Six Siege Trading - 2 Replies
I'm passing here to tell you that the cheat -BattleByeR6- is the better cheat, 100% reliable. In this cheat -BatlleByeR6- there is no risk of getting banned, it will be added several other options in our cheat -BattleByeR6- ● Interested in adding contact at discord : BattleBye #9647 Or enter into our discord BattleBye : https://discord.gg/dbHUSmu Options of our cheat BattleyeR6
[Selling] [CODE][/CODE][BATTLEBYE-CHEATS]-✅ESP,GLOW,NO-RECOIL,FLY,TP,SILENT-AIM-✅ [CODE][/CODE]
07/20/2019 - Rainbow Six Siege Trading - 0 Replies
I'm passing here to tell you that the cheat -BattleByeR6- is the better cheat, 100% reliable. In this cheat -BatlleByeR6- there is no risk of getting banned, it will be added several other options in our cheat -BattleByeR6- ● Interested in adding contact at discord : BattleBye #9647 Or enter into our discord BattleBye : https://discord.gg/dbHUSmu
[Selling] [CODE][/CODE][BATTLEBYE]-✅ESP,GLOW,NO-RECOIL,FLY,TP,AIM.✅[CODE][/CODE]
07/19/2019 - Rainbow Six Siege Trading - 0 Replies
I'm passing here to tell you that the cheat -BattleByeR6- is the better cheat, 100% reliable. In this cheat -BatlleByeR6- there is no risk of getting banned, it will be added several other options in our cheat -BattleByeR6- ● Interested in adding contact at discord : BattleBye #9647 Or enter into our discord BattleBye : https://discord.gg/dbHUSmu
Suche Proxy Listen, Vornamen Liste, Nachnamen Liste, e-mail listen
11/24/2012 - elite*gold Trading - 6 Replies
Hi topic regelt postet einfachh treasuren und schreibt wieviele das sind bei denn e-mails bitte e-mail:pw die proxies das ich sie alle gleich verwenden kann
trouble shooting
05/23/2006 - Conquer Online 2 - 1 Replies
Ok well ive played CO for about a year 1/2 now, never had realy any troble with it, but about a month ago during game play my computor would just shutdown, no error are nothing. Scaned n nothing came up. So it still kept happening , and i reinstalled the game, but it still happens computor shutsdown when pling CO almost every tens mins. I dont know a great deal about computors , but i would greatly apriciate any adive.



All times are GMT +1. The time now is 04:52.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.