Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 65233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:54:52+00:00 2026-05-10T18:54:52+00:00

Could somebody please point me in the right direction for learning how to do

  • 0

Could somebody please point me in the right direction for learning how to do networking in C#/.net 3.5? Code samples and explanations are welcome. Basically I am looking for how to do asynchronous/multithreaded server/client models.

I am fairly comfortable with the basics in how to accomplish this in C++ with WinSock but though all of my research cannot seem to grasp this concept in C#.

Thanks for any assistance you can provide 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T18:54:52+00:00Added an answer on May 10, 2026 at 6:54 pm

    If WCF meets your needs, it’s worth looking at. ZeroC and other alternative higher level libraries exist. Otherwise there are several different ways to work closer to the socket level if that’s what you need.

    TcpClient/UdpClient

    These provide a relatively thin wrapper around the underlying sockets. It essentially provides a Stream over the socket. You can use the async methods on the NetworkStream (BeginRead, etc.). I don’t like this one as the wrapper doesn’t provide that much and it tends to be a little more awkward than using the socket directly.

    Socket – Select

    This provides the classic Select technique for multiplexing multiple socket IO onto a single thread. Not recommended any longer.

    Socket – APM Style

    The Asynchronous Programming Model (AKA IAsyncResult, Begin/End Style) for sockets is the primary technique for using sockets asynchronously. And there are several variants. Essentially, you call an async method (e.g., BeginReceive) and do one of the following:

    1. Poll for completion on the returned IAsyncResult (hardly used).
    2. Use the WaitHandle from the IAsyncResult to wait for the method to complete.
    3. Pass the BeginXXX method a callback method that will be executed when the method completes.

    The best way is #3 as it is the usually the most convenient. When in doubt, use this method.

    Some links:

    • MSDN Magazine Article on Sockets
    • A Jeffery Richter Article on the Asynchronous Programming Model

    .NET 3.5 High Performance Sockets

    .NET 3.5 introduced a new model for async sockets that uses events. It uses the ‘simplified’ async model (e.g., Socket.SendAsync). Instead of giving a callback, you subscribe to an event for completion and instead of an IAsyncResult, you get SocketAsyncEventArgs. The idea is that you can reuse the SocketAsyncEventArgs and pre-allocate memory for socket IO. In high performance scenarios this can be much more efficient that using the APM style. In addition, if you do pre-allocate the memory, you get a stable memory footprint, reduced garbage collection, memory holes from pinning etc. Note that worrying about this should only be a consideration in the most high performance scenarios.

    • MSDN Magazine: Get Connected With The .NET Framework 3.5
    • MSDN Information with technique for pre-allocating memory

    Summary

    For most cases use the callback method of the APM style unless you prefer the style of the SocketAsyncEventArgs / Async method. If you’ve used CompletionPorts in WinSock, you should know that both of these methods use CompletionPorts under the hood.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could somebody point me to an example how to search for phrases with Lucene.net?
Could somebody please explain to me why does this code only print 42 instead
Could somebody please do a rundown of how to programmatically encrypt a config-file in
Could somebody please name a few. I could given time, but this is for
Could somebody please explain to me what happens here? I am creating a binding
Could somebody please elaborate on the differences?
Could somebody please tell me what is Memory Page Out Rate. I have seen
I am confused uisng joins method in Threads Could somebody please explain I have
Could somebody give me a brief overview of the differences between HTTP 1.0 and
I'm not the best at PHP and would be extremely grateful if somebody could

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.