Re: Socket.BeginReceive errorCode parameter

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I'm not sure I would say "only." ;-)

There is quite a lot in the .Net Framework that is for the "convenience"
(i.e. "productivity") of the developer, including language enhancements such
as anonymous methods, etc. I have spent quite awhile looking up socket error
codes myself, and I can testify that having an enumeration is quite helpful!

But as for "an alternative way to get info about function success or failure
without try {} cat{}" I would have to say no. The SocketError enumeration
does include a few "success" codes, but if the socket doesn't throw an
exception, you're not likely to need them. All computer functions return
numeric values, and for many years Microsoft used them. But the .Net
programming model uses Exceptions which don't have numeric values (numbers
are highly counter-intuitive as descriptions to humans), but messages
instead. I believe that the enumeration is for the benefit (productivity) of
the developer/debugger.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Alexander Smirnov" <s_alexander04@xxxxxxx> wrote in message
news:1176209014.923804.212630@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
So the purpose of errorCode parameter is only for conveniance? I hoped
that it is alternative way to get info about function success or
failure without try{} catch{}.




.



Relevant Pages

  • Re: VS.NET vs Notepad
    ... > I'm in a rather unique situation where I have to justify the purchase and ... complexity of your solutions grow the productivity advantages of an IDE over ... Visual Studio vs. another developer writing code in an editor. ...
    (microsoft.public.vsnet.general)
  • RE: Deny access to copy files
    ... "I think the above should work, I know it is restrictive to the developer, but we are trying to find a solution aren't we?" ... To achieve a acceptable security processing much of the responsibility is left to the programmer. ... Microsoft.NET Framework Developer's Guide, Introduction to Code Access Security, ... BDO Kendalls is a national association of separate partnerships and entities. ...
    (Security-Basics)
  • Re: C++ Compared to C#
    ... Back in 1989 C++ was a fantastic stepup from C, but many of the features ... > written using the .NET framework can take slightly longer than traditional ... although for most apps this slight delay is not a problem - unless ... > months you 'should' find your productivity increasing quite significantly ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: .NET Framework - how important?
    ... .NET Framework is the runtime engine and environment ... services that the .NET-based apps need to run. ... to the developer is that it allows a shorter development time by ...
    (microsoft.public.windows.vista.general)
  • Maybe OT: Microsoft suggesting Open Source - Go figure
    ... "Ten Must-Have Tools Every Developer Should Download Now" ... "NUnit - NUnit is an open source unit testing framework built for the .NET Framework." ... These tools, however, have been available for Java for a while. ... didn't Java (and its reflection capabilities) introduce the world to the concept of reflection ...
    (borland.public.delphi.non-technical)