Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / May 2005

Tip: Looking for answers? Try searching our database.

Networking question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ioannis Vranos - 25 May 2005 16:30 GMT
When we have a TcpClient or TcpServer or UdpClient, receiving data and then processing
them inside an infinite loop, inside a method executed by a Thread, I assume that the data
being received while the previous data are processed inside the loop, are queued or
something and are not dropped right? Exactly how much data this "queue" can hold?

An example of such a member function:

// UdpClient *client;
// IpEndPoint *receivePoint;
void Form1::WaitForPackets()
{
  while(true)
  {
      Byte data __gc[]= client->Receive(&receivePoint);

      displayTextBox->Text= String::Concat(displayTextBox->Text, S"\r\nPacket received: ",
                            S"\r\nLength: ", data->Length.ToString(), S"\r\nContaining: ",
                            System::Text::Encoding::ASCII->GetString(data), S"\r\n");
  }
}
Willy Denoyette [MVP] - 26 May 2005 20:44 GMT
> When we have a TcpClient or TcpServer or UdpClient, receiving data and
> then processing them inside an infinite loop, inside a method executed by
[quoted text clipped - 20 lines]
>   }
> }

The network stack queues the data received at several levels, the size of
the queues are dynamically adjusted depending on a numer of parameters like
OS version, network configuration settings, speed etc..
The data in the queues are simply waiting to be passed to the application in
case of a receive or to the network in case of a send, the remaining queued
data is dropped when a socket is closed however.

Willy.
Ioannis Vranos - 27 May 2005 15:55 GMT
> The network stack queues the data received at several levels, the size of
> the queues are dynamically adjusted depending on a numer of parameters like
> OS version, network configuration settings, speed etc..
> The data in the queues are simply waiting to be passed to the application in
> case of a receive or to the network in case of a send, the remaining queued
> data is dropped when a socket is closed however.

An interesting property that I came across is Socket::Available. It returns the amount of
bytes that are queued and wait to be received by the application. Now one can easily
create a sample application that will keep sending to itself without receiving, and will
be displaying the current value of Socket::Available until something happens (if it
happens). :-) If there is an upper "hard-coded" (that is in windows or .net source code)
limit of the receive queue, it will be shown in this way.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.