Jump to content
  • Advertisement
Sign in to follow this  
Afr0m@n

.NET framework 2.0 BeginReceive() information?

This topic is 4525 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does anyone have any code examples for the .NET framework 2.0's BeginReceive function? All the info I can dig up on async networking utilizes the old BeginReceive function from .NET 1.1. I've found the MSDN page for the new version of the function, but it doesn't have code examples - and not only that, but it seems to be faulty as well in the information it provides (seeing as my MSVC 2005 Express compiler is complaining about the first buffer parameter which I've declared as an array of Byte (not byte), which, according to MSDN, should be correct). The MSDN page is located here.

Share this post


Link to post
Share on other sites
Advertisement
this is how i use it:


DataPacket packet = new DataPacket();
packet.ClientSocket = m_Connections;
packet.DataArray = new byte[m_Connections.Available];
AsyncCallback callback = new AsyncCallback(ReceiveEnded);
m_Connections.BeginReceive(packet.DataArray, 0, m_Connections.Available, SocketFlags.None, callback, packet);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!