.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

Clear the socket buffer

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :.NET Framework
I am working with a socket code in C#
The problem is that clients get's randomly disconnected from the server.
Is the right thing to do to clear the buffer?
How do I clear the buffer?

        private void dataArrival(IAsyncResult iAr)  

View Complete Post

More Related Resource Links

Windows UDP Socket Buffer (Maximum)

I am receiving on a socket (C#) and setting the UDP buffer size to br 10 Mb - and creating 16 such sockets. But I see missed UDP packets (they have  a unique seq number in them). When I read back "ReceiveBufferSize" it return the size I set it to - 10Mb.   My question is - what is the maximum internal socket buffer size allowed by Windows (Win Server 2008) ?   Wierdly when I also start Netmon in the background on the receiving machine - I do not see any missed packets.   Does Netmon modify internal windows socket buffers (increase them) - how can I go about doing this with my app ?   Thanks

Get Same Buffer Size in Socket Programming


Dear All,

Actually i am developing an app which send audio file from client to server and server read the byte and save that file in waver format problem is that  i want to send buffer size of audio file or audio length to server but didint get the same size so plz help me regarding this prob

i am using c#

How to set session timeout and clear session in asp.net C# ? And kill session when close the web app


hi ,

How to set session timeout and clear session in web.config and login.aspx  ? And when we close the web application , the session must be cleared ?

I have use session.abandon as per below but is not working . Pls advise .


        protected void btnLogout_Click(object sender, EventArgs e)



Webservice using socket layer programming



   I want to access a webservice in asp.net programming. This webservice was done using socket layer programming and also i am having the ipaddress and port address. Did any one know about how to access webservice using socket layer and if know let me know how to access the webservice. Thank you

i need clear idea and explanation about view state


can any one please explaine me about view state property, i need the basic thing, what is it actually, and why we use, wthat is the use of it. and etc etc plsssssssssssssss

Clear Dropdown Value


I have cascading dropdown 3 levels deep. I am using the owssvr.dll to pre-filter the list. So the when a user changes the selection on the first level the second and third level need to be reset (re-filtered).


I was able to accomplish this on the second level XPathNavigator and the following code:

public void CTICategory_Changed(object sender, XmlEventArgs e)
 XPathNavigator root = MainDataSource.CreateNavigator();    

      // Get the value for the selected Category
      string CTICategory = root.SelectSingleNode("/my:myFields/my:CTICategory", NamespaceManager).Value;
      // Clear the last selected value in the Type drop-down list box
      root.SelectSingleNode("/my:myFields/my:CTIType", NamespaceManager).SetValue("");

      // Retrieve the data connection bound to the CTI Type drop-down list box
      FileQueryConnection con = (FileQueryConnection)DataConnections["CTIType"];

      // Change the location of the data connection to point the XML file
      // returned by the owssvr.dll with a filter on Category
      con.FileLocation = @"http://scmoss06/sites/EventTracker/_vti_bin/owssvr.dll"
      + "?Cmd=Display&List=%7BA0690852%2DCD7B%2D430A%2DB07B%2D9DBF56371E31%7D"
      + "&XMLDATA=TRUE&noredirect=true&a

Adding table to a page, but the format lost when I use clear border



I added a table to a page, by default, the table layout is the light border. So, I add my content and the vertical align seems to set to the top. But when I changed it to clear border, the content of the table will set vertical align to center. Is there a way to change this back to top align but with the clear border. I don't think I can do this by what is available in the ribbon. Please advice.

How to clear cache


We have an ASP.NET-based print tool that will create a printable version of a webpage (as a PNG, I believe). The URL is something like:


which is displaying an older version of the webpage.

The URL to just the webpage displays the current version:


Observations so far:

  • I've deleted temporary Internet files on clients, which had no effect.
  • The behaviour is the same on different clients, which suggests a server issue.
  • I've requested that the temporary ASP.NET files are deleted from:
    C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\mysite_tools_printfromweb
    (It's a customer's web server. I've checked the version of ASP.NET associated with the tool.)

So, my questions are:

Am I right in thinking this is probably a caching issue, and are there any other locations and/or settings I should be looking at?

With thanks.

I like to clear the IE browser Pagesetup--> Header and footer using 1.1 Dotnet framework


Hai all,

I like to clear the IE Pagesetup--> header and footer using Asp.net 1.1 , I have tried in 2.0 Dotnet it works fine it is not working in 1.1 and its urgent too

this is the code i tried ...........

 public void IESetupFooter()
        string strKey = "Software\\Microsoft\\Internet Explorer\\PageSetup";
        bool bolWritable = true;
        string strName = "footer";

Clear Output Cache


I have set the output cache for 5 pages(5 minutes)

I want to clear  all these pages from cache on some nutton click 

10 MB File Download In ASP.NET Socket Error

Hi,I received the following error message, when downloading file of 10 MB. Please let me know the solution. I already configured the httpRuntime value to <httpRuntime maxRequestLength="10250 " executionTimeout="1000". Still I am getting the error message.The description for Event ID ( 0 ) in Source (XXXXX) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: Unable to read data from the transport connection: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full. Source: mscorlib TargetSite: Void HandleReturnMessage(System.Runtime.Remoting.FileUploading.IFileUpload, System.Runtime.Remoting.FileUploading.IFileUpload) StackTrace: Server stack trace:    at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size)   at System.IO.BufferedStream.Read(Byte[] array, Int32 offset, Int32 count)   at System.IO.BinaryReader.ReadBytes(Int32 count)   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadArrayAsBytes(ParseRecord pr)   at System.Runtime.Seri

WCF Service for socket TCP

Hi all, I have a problem. I have to implement a WCF service that responds to clients that do not use a WCF technology. Clients use sockets and TCP. What might be the best solution?

Can't bind a UDP socket to a port

using System; using System.Net; using System.Net.Sockets; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { int port = 11000; Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); IPEndPoint ipendpoint = new IPEndPoint(IPAddress.Any, port); try { socket.Bind(ipendpoint); Console.WriteLine("Successfully bound to port " + port); } catch (SocketException e) { Console.WriteLine("Winsock error: " + e.ErrorCode.ToString() + ", " + e.Message.ToString()); } Console.Read(); } } } I get the error code [b]10022[/b] when trying to bind the UDP socket, which is "Invalid argument specified". This is the same for all the UDP server examples on the internet at the binding stage, as well as the MSDN one. It will work if the port is 0, but not if the port is anything but 0. TCP binding works fine, and I can make a UDP server on any port with Java (the binding works fine) but in C# it gives me this error. The code works for everyone I've asked to try it, and I've got the latest NET framework (version 4) and Windows XP with SP3 so I know the commands are supported by the OS (also, Visual C# 2010 Express and 2008 Express both give this error). Any ideas to fix it?

How to setup windows server 2008 to enable socket communication?

I wrote a simple socket program, which listens to the 82 port, then receives and sends data through it. I tested the program on my local machine and it works fine, but after I published the program onto my windows server 2008, it does not work anymore. I guess it should be the firewall causing the problem, so I added rules to allow 82 port for both in and out bound, and I also add my application to the allowed program list for passing firewall, but still doesn't work, how could I solve it?   The windows server 2008 machine has a public network IP address, while my workstation is in a local network without public IP address, I connect to server 2008 through a router which has a public IP address. Is that the problem?   thanks! Regards! directfriends.net

Script components on 64bit environments - Is there a clear answer for that?

Hello all,  I'm having an issue with a package that contains a script component. The package was originally designed in SSIS 2005, was migrated to 2008 and not to a 2008 64 bit machine. We're able to run the package in VS/32 bit mode, but it fails when we deploy the package. I was able to find a few articles out there, but not clear answer for this issue. Is it possible to run packages with scripts in 64 bit machines? The script is pretty simple, it only reads configuration from the machine.config file. Below is the error message I'm getting:     Executed as user: CITRITE\svcacct_qasqlapps. Microsoft (R) SQL Server Execute Package Utility  Version 10.0.2531.0 for 64-bit  Copyright (C) Microsoft Corp 1984-2005. All rights reserved.    Started:  4:13:22 PM  Error: 2010-08-30 16:13:22.70     Code: 0x00000001     Source: Script Task      Description: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.     at ScriptTask_4b9f5fd6bf8e4c5e99a637abdc7bd178.vbproj.ScriptMain.Main()     --- End of inner exception stack trace ---     at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct&

TypePerf, Buffer Cache Hit Ratio, Page Life expectancy and some other counters....

Hello, I 've scheduled a Task on a Windows 2008 R2 Server (a Blade with 2 Processors (6 core HT) and 18 GB RAM) to check some SQL Server 2008 Performance Counters. The task runs TypePerf that checks the Counters every 15 seconds for 10 minutes. The task is scheduled every hour. The strange result is that Buffer Cache Hit Ratio, Page Life expectancy and some other Counters are ALWAYS = 0 but if I run PerfMon, Buffer Cache Hit Ratio is 100 and  Page Life expectancy >>>> 300. Any Idea? Thank youLuca Bovo MCTS - MCITP SQL Server 2005 (Database Administrator and Database Developer)

Reinitialize transaction replication clear the subcriber data and replicating again

Hi all, I add new table in to mu publisher database and reinitialize the subscriber.And i select the option to create new snapshot and marked as reinitialize.When it starts the reinitializing it clear all data from subscriber and coping again.Am i missing any thing here to add new table into existing replication ? Regards, Theesh
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