473,326 Members | 2,438 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,326 software developers and data experts.

Closing TCP Conections with multi-threaded web service calls

Hi Everyone,

I have a windows service which consumes a web service on a separate machine
in our network. I modified my machine.config to allow my service application
to make 200 connections to the server at once, and I spool up to 200 threads
at once to make calls to the server. All of this works great and as expected.

However I have noticed that by default the underlying connections tend to
stay open for about 90 seconds after my web service calls terminate. So if I
use a tool like TCPView I can see that I still have hundreds of connections
that remain open even after explicitly calling the .Dispose() method of my
proxy objects.

Is there a way that I can force those connections to close from my Service?
Or is that controlled by the server?

Thanks a Million.

John Rossitter

Nov 23 '05 #1
2 2091
John,
Internally we pool the connections. These connections stay open for the
duration of MaxIdleTime. You can set that through the ServicePoint or
ServicePointManager.
For example

Request.FindServicePoint().MaxIdleTime = 3000; //3 seconds

In furture please post these Netwokring Questions to
http://forums.microsoft.com/msdn/Sho...spx?ForumID=40

Thanks
"John Rossitter" wrote:
Hi Everyone,

I have a windows service which consumes a web service on a separate machine
in our network. I modified my machine.config to allow my service application
to make 200 connections to the server at once, and I spool up to 200 threads
at once to make calls to the server. All of this works great and as expected.

However I have noticed that by default the underlying connections tend to
stay open for about 90 seconds after my web service calls terminate. So if I
use a tool like TCPView I can see that I still have hundreds of connections
that remain open even after explicitly calling the .Dispose() method of my
proxy objects.

Is there a way that I can force those connections to close from my Service?
Or is that controlled by the server?

Thanks a Million.

John Rossitter

Nov 23 '05 #2
Hi Durgaprasad,

As you requested I re-posed my question on the form.
I did not understand 100% what you meant by Request in your example but you
can read what I tried at
http://forums.microsoft.com/msdn/Sho...?PostID=106172

Thanks for the help,

John Rossitter
"Durgaprasad Gorti" wrote:
John,
Internally we pool the connections. These connections stay open for the
duration of MaxIdleTime. You can set that through the ServicePoint or
ServicePointManager.
For example

Request.FindServicePoint().MaxIdleTime = 3000; //3 seconds

In furture please post these Netwokring Questions to
http://forums.microsoft.com/msdn/Sho...spx?ForumID=40

Thanks
"John Rossitter" wrote:
Hi Everyone,

I have a windows service which consumes a web service on a separate machine
in our network. I modified my machine.config to allow my service application
to make 200 connections to the server at once, and I spool up to 200 threads
at once to make calls to the server. All of this works great and as expected.

However I have noticed that by default the underlying connections tend to
stay open for about 90 seconds after my web service calls terminate. So if I
use a tool like TCPView I can see that I still have hundreds of connections
that remain open even after explicitly calling the .Dispose() method of my
proxy objects.

Is there a way that I can force those connections to close from my Service?
Or is that controlled by the server?

Thanks a Million.

John Rossitter

Nov 23 '05 #3

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

Similar topics

6
by: Al the programmer | last post by:
I want to catch the Closing event for my form. I created a test windows app using the wizard. I then create the Closing event by clicking the lightning bolt on the properties pane. The code is...
1
by: **Developer** | last post by:
When I get a closing event in a MID Child form I don't know if the child form is closing or the main form is closing. Is there a way to tell? Thank
2
by: Just Me | last post by:
I've seen this in example code: Private Sub Studio_Closing(ByVal sender A..snip.. Handles MyBase.Closing If e.Cancel Then Exit Sub ....snip... It would make sense if Windows keeps doing...
22
by: JPSutor | last post by:
when I use the AppDomain.UnLoad method (which calls the Thread.Abort method), I get the following error message AppDomain can not be unloaded because the thread 1378 can not be unwound out of it...
4
by: Academic | last post by:
Does it make sense to put this If e.Cancel Then Exit Sub at the beginning of form closing events so if the user cancels the app's exiting in one Closing routine he will not be asked again by...
4
by: Franky | last post by:
The Closing event is broadcast by the multi-cast delegate which sends the event to all subscribed delegates. I wonder if the MDI container receives this event and then sends one to each...
3
by: sravan_reddy001 | last post by:
i want to prevent a form from closing.. to do this i want to handle the formClosing or FormClosed events. from here i want to prevent the form from closing. New instance of same form should...
1
by: Paul Rubin | last post by:
it looks like contextlib.closing fails to be idempotent, i.e. wrapping closing() around another closing() doesn't work. This is annoying because the idea of closing() is to let you use legacy...
4
by: =?Utf-8?B?a2F5a28yMDAw?= | last post by:
Hey folks, I'm having a bit of an issue with how Windows Vista (or my ASUS notebook) handles closing my notebook lid. If I have an external monitor (my TV through S-Video) connected to my...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.