Comments (7)
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.
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.
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.
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.
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.
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.
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)
- Client receives message incorrenctly HOT 2
- UNITY 4.5 & WEBPLAYER Compatibility HOT 1
- NullPointer thrown on Property with no Setter HOT 2
- Feature Request: Compression HOT 3
- NetRandomSeed.cs compiling error HOT 3
- NetPeer.MessagePools Recycle method NullReferenceException HOT 1
- The first message sent as UnreliableSequenced does not arrive. HOT 2
- WP8 and Win8 Store App support HOT 2
- IPv6 support HOT 1
- Message recycling HOT 1
- Disconnect regulary sent before previous messages delivered HOT 3
- [deleted issue]
- VS2010 sln/csproj HOT 7
- NetPeer.SendCallBack HOT 1
- Got ack for message not yet sent?
- The UPnP port forwarding fail on Mac Mono HOT 5
- "message already sent" when sending unreliable messages very quickly HOT 4
- ReliableOrdered Messages not received HOT 11
- This platform is not supported Mac OS X HOT 2
- Client disconnects after a few seconds HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lidgren-network-gen3.