473,507 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# API for networking.

Hi,
I am writing a multithreaded application. Each thread creates an
object of WebClient class of C# to open a new connection to the server
everytime.
However, the API seems to be optimizing this and hence it is opening
only two TCP connections to the server for the complete set of
threads. To simulate some real life scenario, I need to open separate
connection for each thread.

Can you please suggest how one can tell the API to open a new
connection everytime? Are there any other API's in C# for networking?

Regards,
Ram
PS:I want to avoid sockets :)
Nov 15 '05 #1
4 3131

"Ramkrishna Kulkarni" <ra****************@yahoo.com> wrote in message
news:55**************************@posting.google.c om...
Hi,
I am writing a multithreaded application. Each thread creates an
object of WebClient class of C# to open a new connection to the server
everytime.
However, the API seems to be optimizing this and hence it is opening
only two TCP connections to the server for the complete set of
threads. To simulate some real life scenario, I need to open separate
connection for each thread.

Can you please suggest how one can tell the API to open a new
connection everytime? Are there any other API's in C# for networking?


http://msdn.microsoft.com/library/de...management.asp

In your configuration there's a setting that controls this. It's set by
default in machine.config to allow only 2 connections to each web server
(just like IE).

You can change it there, or set it in your app.config.
<system.net>
<connectionManagement>
<add address="*" maxconnection="2"/>
</connectionManagement>
</system.net>

David
Nov 15 '05 #2
> In your configuration there's a setting that controls this. It's set by
default in machine.config to allow only 2 connections to each web server
(just like IE).

You can change it there, or set it in your app.config.
<system.net>
<connectionManagement>
<add address="*" maxconnection="2"/>
</connectionManagement>
</system.net>

David


Hi David,
Thank you very much. Increasing maxconnection value in machine.config
file solved my problem.
Regards,
Ram
Nov 15 '05 #3
Hi,
After modifying the machine.config file, my application is opening
more than two connections. However it is now getting restricted to
number of threads in the application. Only one connection per thread
(I am creating 3 objects of WebClient class per thread).
I searched *.config files for something like <maxconnections per
thread>. However din't find anything which specifies number of
connection per thread.
Is there anything like this in the config files or any method in C#
which allows us to specify HTTP connection per thread?

Regards,
Ram
Nov 15 '05 #4
Hi,
This is a reminder to my earlier question.
If anybody knows of any .Net config files or other methods by which we
can specify how many connections to establish between two machines,PER
THREAD, please let me know.
Regards,
Ram
Nov 15 '05 #5

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

Similar topics

1
1667
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
2821
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...
7
8910
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
2056
by: H.A. Sujith | last post by:
Why doesn't the standard library provide (at least basic) networking facilities using TCP/IP ?
4
1742
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
10979
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...
2
1595
by: JCB19 | last post by:
I need help networking my HP DV4000 laptop to my home network. I have wireless home network with 3 computers using Linksys Wireless G The laptop has built in wireless capability. I want to...
1
5269
by: ebrimagillen | last post by:
Want to know the difference between URL networking and Socket networking. Also and example from each and the networking technique is most appropriate for the example.
1
1890
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.
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7114
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
7377
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...
0
7488
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.