473,386 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Networking question

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");
}
}
Nov 17 '05 #1
2 896

"Ioannis Vranos" <iv*@remove.this.grad.com> wrote in message
news:e3**************@TK2MSFTNGP09.phx.gbl...
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");
}
}


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.
Nov 17 '05 #2
Willy Denoyette [MVP] wrote:
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.
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: hyperbob | last post by:
Hello, I'm in the design stage of an application that will consist of two or more processes that will be either on different computers in a network or on the same computer and will have to...
6
by: James Egan | last post by:
I've seen some networking toolkits for C++, but was wondering if there were (or plans for) a standard set of networking classes for C++? Also, can someone tell me where I can find a...
11
by: Steve Jorgensen | last post by:
Now, I don't mean that it's stupid in general. I'm actually pretty impressed with the whole MS Networking thing, but there's one stupid thing that keeps getting in my way, and I can't believe no...
7
by: Brian Keogh | last post by:
Hi, I'm a student learning TCP/IP networking at University. Although I understand all about TCP/IP Networking in Java I am expected to understand the basics of C with regard to these programs as...
46
by: H.A. Sujith | last post by:
Why doesn't the standard library provide (at least basic) networking facilities using TCP/IP ?
4
by: Raj | last post by:
I want to program C with networking. Can anyone tell me the How to start with a small simple program can it possible in turbo/borland c 3+. or i should go for another verson. i am using windows...
0
by: petro | last post by:
I am trying to deploy an asp.net application to my web server. My application uses system.data.oledb to connect to an oracle database. On my development machine I have the oracle client 10g...
1
by: Brian Henry | last post by:
Hello, I was tring to learn socket's (being i never used them before) and have a simple question. I want to create a listner that will get any data recieved and print it out. I've been able to...
1
by: chinaemerem ibeawuchi | last post by:
What is the difference between URL networking and Socket networking? with an example of each type and state why the choosen networking technique is most appropriate for the example.
1
by: Grouchy.Oldgit | last post by:
Does anyone have experience (good or bad) with running any of the growing number of open source social networking platforms - eg elgg, phpizabi, PHP Social Flies etc etc
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.