.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

Response very slow - UdpClient

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :.NET Framework

Hi all,

   In my application i am using UdpClient class for communication between the PC and the device. There are 3 tabs, on click of each tab a WindowsFormsControlLibrary (a dll) is opened an on click of any button in these tabs a request to the device is sent via udp socket and the device sends the response for the corresponding request. On receiving any response from the device the respective slot is called by the use of events and delegates.  A thread is created to notify the respective slots in the different tabs  when some response is received. For every 1 second the device sends a response to indicate that the device is active. These responses are displayed in the datagridview in one of the tab.

The problem is some responses are lost and because of which the order of responses is not correct. The code is as shown below:


public void dataReceived()


View Complete Post

More Related Resource Links

Response.Redirect slow


I'm in the middle of migrating servers and on the new server Response.Redirect is extremely slow. It takes around 20 seconds for the browser to get the redirect. This is something that was quick on the existing server. It's an ASP.NET 2.0 application, both servers are running IIS6.

Additionally, if I "manually" do the redirect, it's fast. For example:

Existing way:


takes around 20 seconds on the new server

New way:

Response.Status = "302 Moved Temporarily";
Response.AddHeader("Location", url);

is fast on the new server.

Any ideas why Response.Redirect would be so slow on the new server?

SharePoint site response very slow

Hi, We have SharePoint web application. We are hosting it on Windows Sever 2008 along with SQL Server 2008. In the development environment the site works very smoothly. When we deployed the same on our live systems the web application because dead slow. It takes 20-30 mins to load a page and it never let anyone login from a Forms authenticated extention. The windows extention seems to be working fairly decent. I have no clue what is making the site go so slow. Thanks.--Oyshik

Slow response loading XML Document to SQL Temporary Table


My customer's application is creating an XML document and then loading the data in to a temporary table. In development the insert completes in less than a second. In production the insert requires 20 or more seconds depending on the size of the document. The sql server version is 2005 and the builds are the same. The Explain Plan for the production server shows an extra step (Table Spool) with an estimated row count of 10,000. Development does not have this step and the estimated number of rows is only 900. I have been able to reproduce both query behaviors on SQL 2008.

Have I missed a configuration parameter on either the OS Or SQL?


Because of limitations, my script will only generate 50 records:

CREATE TABLE #CIM (ID int identity(1,1), lCIMId int, lColorID int, lChemicalId1 int, lChemicalId2 int, Reactions xml)
declare @xmlCIM as XML
set @xmlCIM='<ArrayOfCIMXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <CIMXML lColorId="3" lChemicalId1="1" lChemicalId2="1025">
      <Reaction lReactionId="15" />
  <CIMXML lColorId="3" lChemicalId1="2" lChemicalId2="1025">

Reporting Services 2008 R2 - slow response on first report and after a certain timeout period


We are using Reporting Services 2008 R2.

We have a Windows Forms client with a main form using a webbrowser control to display the report Home page provided by Reporting Services.

We are finding that the loading of this page is very inconsistent. The first time we load the Windows Forms client at the start of the day the page takes too long, more than 10 seconds. After the first access, the Home Page displays in less than a second. If we don't access the Reporting Services for 20 minutes (estimate), we are back to the 10 seconds for initial load. Can someone explain what is going on?

We have tried to create a subscription to a simple report, this didn't help. We tried to create a console app to make a web request to the reporting services url every 10 minutes, this didn't help. We have looked at the rsreportserver.config and the RecycleTime entry put that doesn't really make sense why this would need to be increased considering it's at 12 hours by default. The issue that we seem to be having is happening on a shorter interval.

Does anyone have any suggestions?

Thank you!

Response.BinaryWrite help needed


Hi all

Im new to .NET and stuck now, so i hope anyone can help my with my problem.

I have a MS SQL database where i have stored some documents as Binary data. I cant figure out how to retrieve them and show/download them in my browser.

I found some guides online and have try to put something together.


private void Write()
 int id = 0;
 string strID = Request.QueryString["id"];
 int.TryParse(strID, out id);

 var db = new ModelDataContext();
 var doc = db.DocumentDatas.Where(x => x.ID == id).FirstOrDefault();

 byte[] byteArray = File.ReadAllBytes(doc);


How do i fill the byteArray with the data?

Thanks in advance :)


VS 2010 Pro is slow



I was wondering if anybody else is finding VS 2010 extremely slow loading a solution - and it pretty much renders the rest of the machine useless until loaded. Everything is slowed to a halt.

I upgraded from VS 2005 - now I think I made a terrible mistake. I cannot afford to try and load 2 solutions simultaneously.

The machine is a Core2 Duo E8400, 3GB of RAM, WinXP SP3. Max I can go to is 4GB. Would upgrading to a 64-bit OS really be worth it (actually only to get 8GB of RAM)?

I'm hoping someone else has found a solution to this particular problem.



Test Run: Web Application HTTP Request-Response Test Automation with JavaScript


Write a simple browser-based request-response test automation using JavaScript that's platform independent and useful when you are working in a highly dynamic environment.

James McCaffrey

MSDN Magazine January 2010

Test Run: Request-Response Testing With F#


This month we show you how to use F# to perform HTTP request-response testing for ASP.NET Web applications.

James McCaffrey

MSDN Magazine July 2009

Test Run: Request/Response Testing with Windows PowerShell


Did you know you can use Windows PowerShell to perform lightweight request/response testing for an ASP.NET Web app? Here's how.

Dr. James McCaffrey

MSDN Magazine May 2008

Talk Back: Voice Response Workflows with Speech Server 2007


Speech Server 2007 lets you create sophisticated voice-response applications with Microsoft .NET Framework and Visual Studio tool integration. Here's how.

Michael Dunn

MSDN Magazine April 2008

Foundations: Build a Queued WCF Response Service


With queued calls in Windows Communication Foundation you can perform work in a disconnected manner by sending messages through Microsoft Message Queuing. Juval Lowy explains.

Juval Lowy

MSDN Magazine February 2007



I need to open a new window with Response.Redirect, Is it possible?

no response when refreshing reportviewer


Hi guys, I've been struggling with this for some time now, but I can't figure out why it's not working. I got a gridview in which I'm selecting a specific row. This gives me a string back, which is used to load some data inside a datatable, using DAL The callback works and it's also giving the correct string to retrieve the wanted data. But when I'm trying to use this fresh data update my reportviewer (.rdlc) nothing happens. For now I'm testing the event with a simple button, but even with the button nothing happens. Does anyone know what I'm missing The DAL is working correct and I'm using .NET 3.5

<rsweb:ReportViewer ID="ReportViewer" runat="server" Font-Names="Verdana" 
                                 InteractiveDeviceInfos="(Collection)"  WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" >
        <LocalReport ReportPath="Office\Reporting\InvoiceReport.rdlc" />                                
    protected void Button1_Click(object sender, EventArgs e)
        string strInvoiceId = "603663";

        tblInvoiceTableAdapter InvoiceAdapt = new tblInvoiceTableAdapter();
        TGU.tblInvoiceDataTable invoiceDt = InvoiceAdapt.GetIn

Live website slow - very urgent


Hi All, 

Finally i came to know because of firebug that  ScriptResource.axd's (multiple) are making my files slow on first click

How do i merge them into 1 ??



1. ScriptResource.axd is making my page slow in first click.

On second click onwards its fine as i have added handler from http://madskristensen.net/post/Compress-WebResourceaxd-in-ASPNET.aspx   It helps performance but from second click onwards.I am testing it with FireBug.

2. I have also seen and treid http://www.codeproject.com/KB/aspnet/AspNetOptimizer.aspx  but not able to make out how to implement in my application.

3. I also tried http://madskristensen.net/post/Optimize-WebResourceaxd-and-ScriptResourceaxd.aspx but it has error, I tried making chnage as per the discussion in url but it is sill giving error.

4. I have also made scriptmanager as release mode

Please help its urgent


Adding a cookie to a response.redirect vs. httpWebRequest


Hello, I will try to be as clear as I can be.  I'm sure this question has been asked but I can't find a suitable answer for this particular situation.

I need to be able to redirect the browser to a new 3rd party page while at the same time supplying a cookie required for some form of authentication on the 3rd party site.

I have managed to get this to work in the following manner:


'SessionID is predetermined by another HttpWebRequest/Response  

Dim sessionCookie As New Cookie("ezproxy", sessionID.Substring(1), "/", ".someother.site")

Dim CookieJar As New CookieContainer


rRequest = HttpWebRequest.Create("where I want to go")

rRequest.CookieContainer = CookieJar

rRequest.Method = "GET"


'Make the request and get the response.

rResponse = rRequest.GetResponse()


'Save cookie(s)

If (rResponse.Cookies.Count <> 0) Then

For Each cook

Web Service that will receive xml request and send xml response


I am trying to create a web service that can do the following functionality:

Request XML 

<?xml version="1.0" encoding="UTF-8"?>
<Authentication UserName="test" Password="test" MyId="0987">

Response XML - After authenticating request xml from client send them back the following response:

<?xml version="1.0" encoding="UTF-8"?>
   <Test MyId="0987">
       <TestType id="11"></TestType>
       <TestType id="22"></TestType>

How can I create web service to do this.

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