.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Closing a WCF connection takes a long time when using SSL

Posted By:      Posted Date: September 28, 2010    Points: 0   Category :WCF

I have a very puzzling problem closing WCF connections. We utilize several different protocols for different customers. The most common is net.tcp. We now have a customer that requires SSL encryption of their WCF calls. It does seem to work, but exhibits some strange behavior when we close the connection.

Closing the connection takes a long time. This could be caused by any number of problems, but the strange thing is that the more data that was transmitted on the connection, the longer it takes to close. Connections that get a small amount of data close reasonably fast, but if a large amount of data was transmitted, closing the connection can take as long as actually retrieving the data. It almost seems as if the data is being retransmitted back to the server for verification before the connection is closed.

We are using reliable sessions and Binary over HTTP protocol.

View Complete Post

More Related Resource Links

WCF Service: takes very long time to start up

Hi, What could be the reasons, why my WCF service takes up to 40 seconds to get started? My service class is set to [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)] I am running a thread inside this class. The WCF service gets initialized and opened within the context of this thread. The Initialization: private void InitializeWCFService() {      // initialize servcie base addrresses      this.SetupBaseAddresses();      //MetaData behaviour : allow HttpGet      ServiceMetadataBehavior metaDataBehavior = new ServiceMetadataBehavior();      metaDataBehavior.HttpGetEnabled = true;      // initialize service host instance      this.seviceHost = new ServiceHost(this, this.httpBaseAddress, this.tcpBaseAddress);      // add service endpoints and behavior.      this.seviceHost.AddServiceEndpoint(typeof(IUpdateServer), this.GetServerBinding(BindingType.Tcp), EndpointName);      this.seviceHost.AddServiceEndpoint(typeof(IUpdateServer), this.GetServerBinding(BindingType.Http), EndpointName);      this.seviceHost.Description.Behaviors.Add(metaDataBehavior);      // MEX endpoint      this.seviceHost.AddServic

Why does it takes such a long time to load a parameter?

Hi all,   I have a parameter which is filled with a set of about 90.000 rows. When running the report, it takes a long time to view the report. While it loads the report the CPU on the client is getting up with 50% and the memory stacks 300 MB. I think that I am doing something wrong as when I run the query directly at the cube, it takes just 9 seconds. Does anybody have coped with this problem? If so, what are the best practices in this? Your help will be greatly appreciated! Daniel

SSIS - OLE DB from VIEW takes long time



I have a question regarding SSIS 2008 and how it handles views. I hope the answer for this question will be a quick "Get a hotfix" heh.


I am experiencing a very odd behavior with setting up a View as a data-source in OLE DB. I have set up a a very simple package (for experimenting) with a Data Flow Task that has only two components, Data-Source and Data-Destination. I have set the data-source to a view and the destination to a table in the same database.

Note: I am developing the package on the server itself.


  • While trying to preview data-source I get an error, "Query Timeout expired (Microsoft SQL Server Native Client 10.0)
  • When executing the package Validation, Pre-Execute phases are complete but no rows are passing through the buffer. I have waited over 12 hours before stop the job. Checking the monitoring verified that IO was on 1. And that no object was locked , which may have caused the package to run so long or not to retrieve data.
  • When connecting to SSMS and doing export of data from the view - it also retrieves no data and the process seems to be stuck.


Additional data:

  • T

first login takes a long time


hi all,

i have set up a moss site, and i notice an interesting thing that the first login of every day usually takes a long time, while subsequent logins of the same day  take  much less time. what could be the problem? is it related to caching behavior?

any suggestions on how to improve the response speed?


Andrew Chen
BI, Data Mining, Analytical CRM

Why WPF bug fixes takes so long time?



Why the feedbacking takes so long time to get official comments? I'm not speaking about getting the issues to be fixed as it takes even more.

The perfect sample:


It is a known bug for a three years (there is a link to a first discussion in a feedback comment), and the offical answer is:

Posted by Microsoft on 8/21/2009 at 2:35 PM
I do understand your concern, but we are beyond our ZBB date, therefore only ship-blocker bugs make the bar at this point. Considering that we have shipped this bug before, it is hard to make a case that we need to fix it in this release since it did not block our previous release. Thank you.

So, the official policy is "Now, we have a six months before RTM but we will not fix any bugs but those that blocks tth product shipment"? Perfect!

I've a bunch of bugs/suggestions submitted and (for most of them) there's no single comment neither reaction for a six month for now. I'm

Closing the download stream (got from HttpWebResponse.GetResponseStream()) takes some time if we clo



I am using HttpWebRequest to download a file from server. When I get the response stream and start reading from it, I need to cancel reading and close this stream in between (this is something like pause download). Please see the code below.



Stream serverStream = resp.GetResponseStream();

Stream localStream = new FileStream(file_path, FileMode.Open, FileAccess.Write);



            HttpWebRequest getrequest;

            getrequest = (HttpWebRequest)HttpWebRequest.Create(download_uri);

            getrequest.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip,deflate");

            getrequest.Timeout = System.Threading.Timeout.Infinite;


WorkflowApplication.Load takes a long time


When I load a persisted WF instance, I can watch a profiler of the DB activity.  From the time I step over .Load until I see the LoadInstance stored procedure execute is taking anywhere from 5 to 10 seconds.  Is there a way to alter this behavior?

Here is how I am creating the Instance Store:

 public class WorkflowLoader : IDisposable
  public SqlWorkflowInstanceStore InstanceStore { get; private set; }
  InstanceHandle mInstanceHandle;
  private string mConnectionString;

  public WorkflowLoader(string connectionString)
   mConnectionString = connectionString;

  public WorkflowApplication CreateInstance(Activity activity, IDictionary<string,object> inputs)
   // if we dont have an instance store, then we have been disposed already

SqlCeConnection.Open() takes very long time


SqlCeConnection.Open() takes very long time if the sdf file is more than 300MB, actually, SqlCeConnection.Open()  will not response in Windows Mobile 6.5 device, but it works in Windows 7.

string connectionString = @"Data Source=\Navigator\tnmsdb_DISTRICT-00001-00008-00017.sdf;Max Database Size = 280";

STSADM ActivateFeature takes too long



I have a solution installed to a web application, this Web App has a lot of Site Collections, these site collections were created with different versions of the wsp package. What I need is a way of activating the new features on the already provisioned site collections.

At first we made a Web Application scoped feature that went through all site collections that were using our template and then activated the features on each site collection but it was giving us a whole bunch of trouble were the code would skip entire site collections or enter the site collection, changing a field that we used for control and not activating anything... Now we have a Web scoped feature that activates all the features within the site collection at either Web or Site scope that we specify through an XML. This works like a charm for every site collection.

The problem is that we need a way of activating that feature on every site collection so I did a batch file that runs the STSADM ActivateFeature to do this. This also works properly but seing the many site collections that we have it is taking more than an hour and a half to finish the batch; is there a way of optimizing this so it runs quicker?

I think that the batch is actually waiting untill the feature is done activating to start to activate the feature on the next site collection, is there a way of a

WCF - First call to Callback instance from Server takes considerable time to make it to the client.

Hello. There's a performance problem we are facing that we are unable to fix using DuplexChannels. The first call made by the client to the server reaches the server instantly. The first call made by the server to the first client using a Callback proxy will take several seconds to reach the client. All subsequent calls to the client (as well as other clients) will reach and execute instantly. The client connects to the Server using a proxy to IServiceProvision, supplies an instance to an implementation of IClientCallback and calls IServiceProvision.Start(). The server instantly processes the call and makes an asynchronous call to IClientCallback.DoWork(), which takes several seconds to enter the client's DoWork() implementation. The remainder of the execution then runs smoothly. Also, the server will experience such a slowdown only for the very first call of the first client that connects to it. Is it normal for the Callback interface to take so much time to warmup, only on the first call to the first client? Below is the full source code. Thanks for any information you may provide. Cheers Mike Shared Class Library using System.ServiceModel; namespace Test { [ServiceContract(Namespace = "http://test/IService", CallbackContract = typeof(IClientCallback))] public interface IServiceProvision { [OperationContract] void Start(); [OperationContract] void

SQLDataAdapter/SQLDataReader takes lot of time for executing a query

All, I have a webpage with 6 drop down lists. User can start with selecting any drop down list first, and then proceed in any order.  1. Assume when the 1st dropdown is selected first, rest 5 drop downs (except 1st) are filtered/updated based on the selected value in the 1st dropdown. 2. Assume user selects the 4th dropdown second, rest 5 drop downs (except 4th) will be filtered/updated but the condition would be based on both 1st drop down and 4th drop down. But while filtering the first drop down, only the 4th drop down is used as filter (self-filter will be ignored). The code works fine but I see a very bad performance hit in time when the user selects the fourth dropdown after selecting three drop downs. I tried using both SQLDataAdapter and SQLDataReader but neither used to solve the issue. The code takes a lot of time on one line in either of the code (which is highlighted below). When I run the query in SQLServer Mgmt Studio, the query completes in a few seconds.Using SQLDataReader: SqlConnection conn = new SqlConnection(CONNECTION); SqlCommand ObjCmd = new SqlCommand(query, conn); ObjCmd.CommandTimeout = 600; conn.Open(); SqlDataReader daSelTools = ObjCmd.ExecuteReader(); //This line takes a lot of time ddl.Items.Clear(); // Call Read before accessing data. while (daSelTools.Read()) { ddl.Items.Add(new ListItem(String.Format("{0}",daSelTools[0])));

SharePoint 2007 + PowerPoint gives "Contacting the server for information" for a long time

I've never had this issue for but today all of a sudden I tried to open a PowerPoint document posted to a document library on our SharePoint 2007 site and it gave a message saying "Contacting the server for information" for a long time.  It eventually opened but not until after 5-10 minutes.  Does anyone know what might have caused this?  The file itself is pretty small, only 70KB, and as I said we haven't had this problem before.

Full database backup takes so long

Today several full database backups took so long. Normally it took 2 hours to backup. But today the 5 backups didn't finish by the end of the work day. The backups went well until yesterday. I don't know what happened overnight. Is there a performance tool embedded in SQL Server? How can I find out why the backups take so long? What could be the possible reasons? Thank you,  

For MYSQLMemberShipProvider read the connection string from external file at run time

Hi, In my asp.net mvc application, I have used "MYSQLMemberShipProvider" .I want to read connection string from external file at run time.I am using MYSQL connectore 6.3.4How can I do thatThanksAayushi

Query takes too long to run

I have the following query, which does an update statement but everytime I run it it took about 1hr and 20 mins to run so I created Indexes because that would solve the problem. After creating the Indexes I re-run the query but it was the same so I checked to see if it was blocked by running the following query and under the spid it had the same spid in under the blocked column, the lastwaittype is PAGEIOLATCH_SH. UPDATE table SET column1 = column2 FROM table1 JOIN table2 ON column1= column2 Thank you

Query takes too long to run

I have the following query, which does an update statement but everytime I run it it took about 1hr and 20 mins to run so I created Indexes because that would solve the problem. After creating the Indexes I re-run the query but it was the same so I checked to see if it was blocked by running the following query and under the spid it had the same spid in under the blocked column, the lastwaittype is PAGEIOLATCH_SH. UPDATE table SET column1 = column2 FROM table1 JOIN table2 ON column1= column2 Thank you

When not open MOSS 2007 site for long time...


Hi all,

I have a web site under constructing using MOSS 2007, when site is not opened for long time, and come some one to open it, MOSS 2007 return error: Error occured, if you have a permission go to webpart editing page to solve the problem...

I don't know why this happen, and how to solve it?



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend