new *Async methods in the Socket class

Anybody have or know of an example on how to use these? No docs and the functions are not exactly intuitive.
[108 byte] By [Valdair] at [2008-1-29]
# 1
i'm interested in seeing this new async method you're referring to, so i can possibly help. This is in orcas that you see a new async socket method? Can you tell me what name space and object this method is under? is there a new version of System.Net.Socket?
JDPeckham at 2007-9-6 > top of Msdn Tech,Visual Studio Orcas,Visual C# Orcas...
# 2

JDPeckham wrote:

i'm interested in seeing this new async method you're referring to, so i can possibly help. This is in orcas that you see a new async socket method? Can you tell me what name space and object this method is under? is there a new version of System.Net.Socket?

Yes it is in Orcas inside the Socket class, BeginAsync etc.

Valdair at 2007-9-6 > top of Msdn Tech,Visual Studio Orcas,Visual C# Orcas...
# 3

The *Async model is the new model to offer async functionality (there is a section in MSDN that describes when and why to use XxxAsync instead of BeginXxx\EndXxx. The typical client usage is:

Socket = new Socket();

socket.XxxCompleted += OnXxxCompleted // OnXxxCompleted is a callback function that the client code needs to implement)

socket.XxxAsync();

Victor

VBADerks at 2007-9-6 > top of Msdn Tech,Visual Studio Orcas,Visual C# Orcas...
# 4
No where in the socket class are there any xxxCompleted. Are you sure it was socket? What is the url for the msdn article? I can't seem to find that either.
Valdair at 2007-9-6 > top of Msdn Tech,Visual Studio Orcas,Visual C# Orcas...
# 5

There's a small example of using SendAsync and some detail why the *Async methods were added in the latest MSDN magazine article Get Connected with the .NET Framework 3.5. Essentially, for heaving load situations the use of IAsyncResult could be limiting and using the Begin* pattern forces use of non reusable IAsyncResult objects.

If you're not interested in a high-performance, heavy load, type socket server I would suggest continuing with the Begin*/End* methods.

PeterRitchie at 2007-9-6 > top of Msdn Tech,Visual Studio Orcas,Visual C# Orcas...

Visual Studio Orcas

Site Classified