Whether to use exceptions in C++ for Socket library? -


i plan build portable socket library c++ programming language. known, errors occurs in network programming. of them recoverable, while others not. plan use exceptions in c++ trace exception, logging operations , inform end-users. using exceptions extremely difficult, , using classic techniques error codes lead code hard read (lots of if statements). what's preference?

by way, there light-weighted socket library (education-purposed welcomed, , ace hard understand)?

the downside of using return codes people forget error handling. cannot happen exceptions. however, if write return code class asserts in destructor unless return value read or explicitly ignored can portability , performance of return values without disadvantage of poor error handling. still have manually forward error codes if caller needs handle exception.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -