.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

How to make a TCP socket stay open or not being reset even after network cable is disconnected?

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :WPF


My goal is to let TCP sockets( both client and server) stay connected even if network cable is disconnected. So when network cable is reconnected, both client and server can resume the communication without re-establish a new connection or reset the connection.

I tested using HyperTerminal. If HT is connected to a TCP server, and unplug the network cable, within 20s, the HP stayed connected. I can resume the communication without re-connect. My server is the embeded system. I have verified that it stays on even cable is unplugged. I don't know Windows XP side, what has timed out or XP network driver resets if cable is unplugged over minutes.

Is there any timeout I can set for XP network card driver to extended such time out?

Pleass help,

Thank you,




View Complete Post

More Related Resource Links

How to make footer section stay below the pagelayout?

Hi. I have a branded site with a top menu section and a similar footer section(33x900px). When I add text in a page and the taxt goes on below the end of the screen, the footer stays at the bottom of the screen and hides part of the text. How can I make it stay at the bottom dynamically? Always below the last line of text below the end of the screen if needed? I have a DIV for the footer section with it's own class so if I just have the correct format, It should be easy to do right? Example: see the 'earthy' footer on Drisgills blog http://blog.drisgill.com/ Thats what I want.   ThanksThomas BalkestÃ¥hl - Technical Specialist - SharePoint

How to make sure that user doesn't open same webpage in two different browsers or browser tabs?



We are using asp.net StateServer for asp.net session management. In our project we need to make sure that if a user is already logged in and if he is trying to acess the website from a different browser tab, we need to inform him that he is already logged in in another tab and use it instead of opening a new session. Consider the following scenarios:

1. User is logged on in tab1 and his session is still on, then user tries to logon from another tab, the browser sends the asp.net session_id cookie, In the page init i am checking if the Asp.net session Id cookie is present, if it is there i am checking if the it is a new Session (i.e. if the existing session timed out), if it is a new session then proceed with the user action else it means that the session in tab1 is still active so i am redirecting user to error page with appropriate message.

Now the problem with this approach is that, suppose session in tab1 is expired and user opens tab2 and performs some actions, now he goes back to tab1 and perform any action, i directly need to take him to log out page.

Please let me know how this can be achieved.

Only one usage of each socket address (protocol/network address/port) is normally permitted IN C# Re



 I done an application in Remoting.Consider a server is running in my machine an listenening the port 8085(Remoting.Configure()) ,I have 2000 Clients They ALL send an update every 2MIN to the server through 8085.

I configure the port like this:

  1. public

  1. void InitNew()
  2. {
  3. try
  4. {
  5. if(_regcnt ==2)
  6. {
  7. MessageBox.Show("Unable to run the server you must restart the system","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
  8. Application.Exit();
  9. return ;
  10. }
  11. UNReg();
  12. chan=
  13. new TcpChannel(8085);
  14. ChannelServices.RegisterChannel(chan);

make Gridview data as hyper link with alias open in new window



I have one asp.net C# page in which i have gridview..

This are the url comes from database and binded in gridview




what i need is i need to show this url has like this

www.xxxxxx.com/A/Default.aspx is like Test1

www.xxxxxx.com/B/Default.aspx is like Test2

www.zzzzz.com/C/Default.aspx is like Test3

if user click Test1 it will open a new browser window with www.xxxxxx.com/A/Default.aspx

if user click Test3 it will open a new browser window with www.zzzzz.com/C/Default.aspx 

how to make this in gridview please help me in this...

how to make cancel and submit buttons open 2 different links


Hello guys,

In browser enabled infopath form i changed the source paramenter of the querystring to some url as i wanted to open a different link when a form is submitted. I want a cancel button to be linked to some other link but it goes to the same link as submit. How can i give 2 seperate links to cancel and submit actions?

Please help!!

Thanks in advance.

How to make my ModalPopupExtender stay in each UpdatePanel refresh?


Hi all,

I have a Gridview which is inside a Updatepanel which is updated through a Timer Control every 5 seconds.
So every 5 seconds I get new data in the rows. I am facing an issue in which I want to display the whole mult-line content of my Textbox(es).
It displays fine but the modal window disappears after the UpdatePanel is updated.

How do I display this pop-up modal window and make it stay while the UpdatePanel continues to update the rows in the background?

Here is part of my code:

    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">                               

         <asp:Timer ID="Timer1" OnTick="Timer1_Tick" runat="server" />
            <asp:Panel ID="PanelRealtimeLogging" CssClass="Panel" runat="server" ScrollBars="Vertical" >                                                                                   
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" AllowPaging="False" AllowSorting="true"


How to make a TreeView's and ListBox's SelectedItem stay in sync? (in an MVVM app)



I'm certain this has come up before, but I haven't been able to find the answer.

I made a basic ViewModel that contains a list of People (an array of Person) with a property called SelectedPerson, which naturally points to the currently selected Person in the list of People. I also have a ListBox and a TreeView that are databound to the ViewModel's People list.

What I'd like to do is to keep the ListBox's SelectedValue and TreeView's SelectedItem in sync with with the ViewModel's SelectedPerson. The idea is that no matter how the SelectedPerson is modified (through a control, through code, etc), all the controls should update themselves properly by selecting the correct item. I can get it to work with two ListBoxes, which is nice, but I can't get it to work with a ListBox and a TreeView because the TreeView's SelectedItem is readonly and apparently unavailable through XAML.

Where should I look to get ideas on making this work?

Also note that I'm trying to make this work in pure XAML. No code-behind as XAML files in my application can be loaded and changed dynamically.


How to make Excel open in application not browser by default


I'm facing a problem here. I tried the to open an excel file (.xls) which was attached in a Calendar Item.

On 1 PC, it opens automatically with the Excel application and thus the user is able to edit and save.
On another PC, it opens in the browser and the user is unable to edit / save the file.

Initially, I tried and thought that it's user rights issue but apparantly, it is not.

How can I make the .xls to open in excel by default? Can someone help me?

Really appreciate the help and answers.


How To Open Fancy Tooltip from GridView

This article will show How To Open show Fancy Tooltip in GridView.

Open ModalPopup dialog on page load


Is there a way to make a modal popup panel active on page load so that the user can't do anything until they deal with the popup dialog?

Beginner: this doesn't make sense to me


Do you need and "empty" script tag in the head to run scripts that are in the body?  Also, can you run JQuery scripts if they're in the <head> tag?  The first sample only works if the JQuery script is in the form (and body) tag, not in the head - even if I add $(document).ready(function() { });

This works

<head runat="server">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" />
<script type="text/javascript">
<form id="form1" runat="server">
<a href="">Here is a link</a>
<script type="text/javascript">
$('a').click(function () {
alert("you clicked me!");


This doesn't work.  Notice I removed the second <script> tag from the head

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="serve

how to make a dropdownlist looks like google search box


dear all...

any idea how to do that ?

Thnx in advance

Using network login



Is anyone have sample code to set up log in page using network login?

For example: User Name(same as Network Login)

                     Password(Same as Network Login)

Your help is highly appreciated.

Need Syntax To Make Results of LINQ Union Return Non-Generic Type



I have the below SQL which works just fine:

SELECT     Message, CreateDate, AccountId, AlertTypeId
FROM       dbo.Alerts
SELECT     TOP (100) PERCENT Status, CreateDate, AccountId,
                          (SELECT     10 AS Expr1) AS AlertTypeId
FROM         dbo.StatusUpdates
WHERE AccountId = PassedInParameter

I have been going about trying to convert the above into a LINQ method and am having problems with return types.
As the above SQL illustrates, I am querying two distinct LINQ tables - Alerts and StatusUpdates -
and then attempting to perform a Union on them. In order to do the union in LINQ, I have to have agreeing types. So, I
am using "var" to make the results of "alerts" and "updates" generic before the union.  

public IList GetStatusUpdatesAsAlertsByAccountId<T>(Int32 accountId)
            using (WorkbookDataContext dc = _conn.GetCont

Unable to make connection to database?


Hy guys. I try to connect my database for so long so i wrote two type of codes. Let's discuse first on.

I have database called PhoneDirectory.

It have only one table named Residents.

I have button wiht ID="Button1".

I want when i click this button to see all of my residents. 

I want to see the result in DetailsView and to be able to edin, delete and add new resident.

First try with SqlDataSource so i wrote this:

<asp:SqlDataSource ID="Resident Details" runat="server" ProviderName="System.Data.SqlClient" ConnectionStrings="<%$ ConnectionStrings:ThisIsTheConnection%>" 
              SelectCommand = "SELECT * FROM Resident "

Open PopUp Window From Error httpModule


I would like to open a popup window from the assembly to present the information to the user. Does anyone know if this is possible, I am presently doing the following:

        WriteLine("body {font-family:""Verdana"";font-weight:normal;font-size: .7em;color:black; background-color:white;}")
        WriteLine("b {font-family:""Verdana"";font-weight:bold;color:black;margin-top: -5px}")
        WriteLine("H1 { font-family:""Verdana"";font-weight:normal;font-size:18pt;color:red }")
        WriteLine("H2 { font-family:""Verdana"";font-weight:normal;font-size:14pt;color:maroon }")
        WriteLine("pre {font-family:""Lucida Console"";font-size: .9em}")

how to make a css style background image be linked to an image in the resource file


hey guy, i need help in a very troubling matter. I want to make a textbox with a specific style, within this style a set of images as background parts, how can i attach these images to the custom control as whenever i take the .dll file and add it to the toolbar the images do not appear. So i tried to make them as resource files and their property as embedded in .resx file, so how to make the css style background image url to be linked to any of those image.

thanks in advance

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