Git Product home page Git Product logo

Comments (7)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
Good thinking! Revision 94 now logs error in release instead of throwing 
exception

Original comment by [email protected] on 10 Aug 2010 at 11:22

  • Changed state: Fixed

from lidgren-network-gen3.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
http://code.google.com/p/lidgren-network-gen3/source/browse/trunk/Lidgren.Networ
k/NetPeer.Internal.cs?spec=svn94&r=94#142

throw new Exception("borak!");

I think it was not supposed to be.


#if DEBUG
                                catch(Exception ex)
                                {
                                        throw;
                                }
#else

First you can just use catch { throw; }
Second, you must not throw exception from thread even in Debug because it 
aborts the program :(

Original comment by [email protected] on 10 Aug 2010 at 11:35

from lidgren-network-gen3.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
Yes; I accidently left some testing code in; patched it 30 seconds later tho in 
r95. In debug you want an exception to be thrown to be able to debug the 
problem; the debugger will break and you can inspect various threads.

Original comment by [email protected] on 10 Aug 2010 at 11:47

from lidgren-network-gen3.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
I disagree with you about debug mode.

I run program with debugger and when it reaches throw; I get "SocketException 
was unhandled" and I cannot continue running my program.

If you want to point a user out in the debug about error, you should use 
System.Diagnostics.Debug.Fail.

Original comment by [email protected] on 10 Aug 2010 at 12:00

from lidgren-network-gen3.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
What's the point of continuing running the program? Since initialization failed 
unexpectedly we cannot keep the network thread alive and for a networked app I 
don't see the point in continuing.
Swallowing the exception in RELEASE is bad enough, but since there's no way of 
catching it easily it's the only way. In DEBUG however you'd want to break as 
early as possible.

The only almost-valid case I see is probing to see if the port is already in 
use; I should probably create a utility method for that.

Original comment by [email protected] on 10 Aug 2010 at 12:30

from lidgren-network-gen3.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
What about case of trying some different end points ? I mean if you try the 
first one and if it fails moves to another one.
Throwing exception there just aborts the program and doesn't allow me to handle 
it in any way.

Is it possible to move binding socket outside the thread ?
Than you just throw exception in the same thread where Start is called.
Everyone is happy.

Original comment by [email protected] on 10 Aug 2010 at 12:52

from lidgren-network-gen3.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
Hmm, yes binding on main thread could be a good idea. I'll do some testing and 
make it so unless there's other issues. 

Original comment by [email protected] on 10 Aug 2010 at 1:12

from lidgren-network-gen3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.