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 8709539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:23:08+00:00 2026-06-13T04:23:08+00:00

I have several points regarding .NET socket implementation so I will state them sequentially:

  • 0

I have several points regarding .NET socket implementation so I will state them sequentially:

  1. My understanding is that an instance of a Socket has a buffer of a changeable size in its internal class implementation, and is actually a queue of bytes, and also is different than the application buffer that you declare and define in your application.
  2. In synchronous mode using socket type:stream and protocol type:tcp , when using the method Receive (which is blocking the process), with a parameter application byte buffer is actually dequeuing the socket buffer in chunks that have the same size of the application byte buffer you declared and defined in your application then assigns this chunk to your application byte buffer you sent to Receive function.
  3. If the above is true, then what happens when the byte buffer is larger in length than the byte elements in the socket queue?
  4. Also, if 2 is correct then Send method of a socket sends the the data to the end point connected host Socket buffer and not application buffer.
  5. Finally, since the Socket method Accept is non-blocking, a thread is created for it in the underlying implementation, and it has a queue of its own that is dequeued when Accept method is called.

I ask all of this to check if my understanding so far is right, or if it’s mostly wrong and need correcting.

  • 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. Editorial Team
    Editorial Team
    2026-06-13T04:23:09+00:00Added an answer on June 13, 2026 at 4:23 am

    First of all .net’s implementation is mostly just a managed wrapper around winsock.

    My understanding is that an instance of a Socket has a buffer of a changeable size in its internal class implementation, and is actually a queue of bytes, and also is different than the application buffer that you declare and define in your application.

    Ok so far.

    In synchronous mode using socket type: … when using the method Receive

    When you call Receive, data will be copied into the supplied buffer and the number of bytes written will be returned. This may well be less than the size of the buffer. If your buffer is not large enough to accomodate all of the data queued by the TCP stack only as many bytes as can be copied into your buffer will be copied, the remaining bytes will be returned on your next call to Receive.

    Sockets treat all data sent (or received) as being a continuous stream without breaks. However, data sent across the network is subject to networks or hosts splitting the data to meet constraints like a maximum packet size. Your code should assumes data may arrive in arbitrarily sized chunks. Incidentally, this kind of message is more likely to appear in a production environment than in a development/testing one.

    socket sends the the data to the end point connected host Socket buffer and not application buffer

    Send will return when the data is queued by the TCP stack. If the TCP window is full and the remote endpoint is not reading off the socket (say because it is waiting for its own send to complete) this could potentially be a long time.

    Finally, since the Socket method Accept is non-blocking

    Per the documentation, Accept will either block until a connection is received or (in non-blocking mode) either synchronously accept the first available connection or throw if no connection is available.

    this is still relevant and would still be recommended reading for anyone about to start writing network code.

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

Sidebar

Related Questions

I have several objects in my app that can become nil at some point
I have several HTML elements (buttons) that fire the same JQuery AJAX request. When
I have several Delphi programs that maintain connections to a database (some Oracle, some
I have several different numbers in a group that range in sizes and would
I have several xml files that are formated this way: <ROOT> <OBJECT> <identity> <id>123</id>
I have found several articles on the Web regarding drawing a dashed line in
I have an Android app that communicates with a server via asynchronous socket connection
Suppose I have several 200mb+ files that I want to grep through. How would
I have an iphone app that has been downloaded in the last two months
I have created a TCP Socket connection in my appDelegate didFinishLaunchingWithOptions method. That was

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.