Re: Socket.BeginReceive errorCode parameter
- From: "Kevin Spencer" <unclechutney@xxxxxxxxxxxx>
- Date: Tue, 10 Apr 2007 14:58:40 -0400
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{}.
.
- References:
- Socket.BeginReceive errorCode parameter
- From: Alexander Smirnov
- Re: Socket.BeginReceive errorCode parameter
- From: Kevin Spencer
- Re: Socket.BeginReceive errorCode parameter
- From: Alexander Smirnov
- Socket.BeginReceive errorCode parameter
- Prev by Date: Re: [feature request] Array.IsNullOrEmpty
- Next by Date: Re: Web service exception
- Previous by thread: Re: Socket.BeginReceive errorCode parameter
- Next by thread: BeginAccept callback problem
- Index(es):
Relevant Pages
|