Slow opening socket on ASP with multihomed machine

Discussion in 'ASP General' started by Jim W, Oct 1, 2004.

  1. Jim W

    Jim W Guest

    This is a cross-post from the .NET group since it looks like it may not be
    ..NET.

    New information since the original post is that is the wireless network is
    enabled and connected the socket connect time is 4x longer! Disable wireless
    and it is back down to just very slow.

    Any ideas are appreciated.

    -----
    I have an ASP.NET app that has very slow connect times using TCPClient, or
    the Socket class, or even calling a COM object that uses C socket calls on
    certain similar XP SP2 boxes.

    On those boxes, if another connection is made within a couple seconds, it is
    fast. Running the same C# code in a console app connects instantly.
    Unplugging the network cable allows localhost connections to be instant (?!).


    Running the same ASP.NET app on W2K or another XP Pro SP2 box is instant, so
    it comes down to being ASP.NET on XP Pro on certain boxes. I've includes the
    test results and programs. The boxes with the problems are laptops. Is it
    an ASP.NET config issue? XP SP2 Security issue? Any ideas/help is greatly
    appreciated.

    Jim W

    Test results:
    XPPro ASP to Remote server
    First took 6 seconds
    Short sleep 1 took 0 seconds
    Short sleep 2 took 0 seconds
    Long sleep 1 took 4 seconds
    Med sleep 2 took 0 seconds

    XPPro ASP to Localhost with network connection
    First took 6 seconds
    Short sleep 1 took 0 seconds
    Short sleep 2 took 0 seconds
    Long sleep 1 took 4 seconds
    Mec sleep 2 took 4 seconds

    XPPro ASP to Localhost unplugged
    First took 0 seconds
    Short sleep 1 took 0 seconds
    Short sleep 2 took 0 seconds
    Long sleep 1 took 0 seconds
    Med sleep 2 took 0 seconds

    XPPro .NET console app to localhost, or remote
    First took 0 seconds
    Short sleep 1 took 0 seconds
    Short sleep 2 took 0 seconds
    Long sleep 1 took 0 seconds
    Med sleep 2 took 0 seconds

    W2K Server to local host, or remote
    First took 0 seconds
    Short sleep 1 took 0 seconds
    Short sleep 2 took 0 seconds
    Long sleep 1 took 0 seconds
    Med sleep 2 took 0 seconds

    Pertinent ASP.NET code behind:
    ....
    private void RunTests_Click(object sender, System.EventArgs e)
    {
    Output.Text = Tester.RunTests( HostName.Text, "<br>" );
    }

    Pertinent .NET console app code.
    ....
    static void Main(string[] args)
    {
    System.Console.WriteLine( SocketTest.Tester.RunTests( args[0], "\n" ) );
    }

    The tester called by ASP.NET and a .NET console app:

    using System;
    using System.Net;
    using System.Net.Sockets;

    namespace SocketTest
    {
    public class Tester
    {
    public Tester() {}

    public static string RunTests( string server, string eol )
    {
    string ret = RunTest( server, "First ", eol );

    System.Threading.Thread.Sleep( 100 );

    ret += RunTest( server, "Short sleep 1", eol );

    System.Threading.Thread.Sleep( 100 );

    ret += RunTest( server, "Short sleep 2", eol );

    System.Threading.Thread.Sleep( 10000 );

    ret += RunTest( server, "Long sleep 1", eol );

    System.Threading.Thread.Sleep( 5000 );

    ret += RunTest( server, "Med sleep 2", eol );

    return ret;
    }

    static string RunTest( string server, string prefix, string eol )
    {
    DateTime start = DateTime.Now;
    TcpClient conn = new TcpClient( server, 80 );
    TimeSpan span = DateTime.Now - start;
    conn.Close();

    return prefix + " took " + span.Seconds + " seconds " + eol;
    }
    }
    }
    Jim W, Oct 1, 2004
    #1
    1. Advertising

  2. Jim,

    I think this has less to do with ASP/ASP.NET, and more with sockets/Wireless
    access. Perhaps you can post this as a "sockets issue" to WinXP newsgroups.

    --
    Manohar Kamath
    Editor, .netWire
    www.dotnetwire.com


    "Jim W" <> wrote in message
    news:...
    > This is a cross-post from the .NET group since it looks like it may not be
    > .NET.
    >
    > New information since the original post is that is the wireless network is
    > enabled and connected the socket connect time is 4x longer! Disable

    wireless
    > and it is back down to just very slow.
    >
    > Any ideas are appreciated.
    >
    > -----
    > I have an ASP.NET app that has very slow connect times using TCPClient, or
    > the Socket class, or even calling a COM object that uses C socket calls on
    > certain similar XP SP2 boxes.
    >
    > On those boxes, if another connection is made within a couple seconds, it

    is
    > fast. Running the same C# code in a console app connects instantly.
    > Unplugging the network cable allows localhost connections to be instant

    (?!).
    >
    >
    > Running the same ASP.NET app on W2K or another XP Pro SP2 box is instant,

    so
    > it comes down to being ASP.NET on XP Pro on certain boxes. I've includes

    the
    > test results and programs. The boxes with the problems are laptops. Is

    it
    > an ASP.NET config issue? XP SP2 Security issue? Any ideas/help is

    greatly
    > appreciated.
    >
    > Jim W
    >
    > Test results:
    > XPPro ASP to Remote server
    > First took 6 seconds
    > Short sleep 1 took 0 seconds
    > Short sleep 2 took 0 seconds
    > Long sleep 1 took 4 seconds
    > Med sleep 2 took 0 seconds
    >
    > XPPro ASP to Localhost with network connection
    > First took 6 seconds
    > Short sleep 1 took 0 seconds
    > Short sleep 2 took 0 seconds
    > Long sleep 1 took 4 seconds
    > Mec sleep 2 took 4 seconds
    >
    > XPPro ASP to Localhost unplugged
    > First took 0 seconds
    > Short sleep 1 took 0 seconds
    > Short sleep 2 took 0 seconds
    > Long sleep 1 took 0 seconds
    > Med sleep 2 took 0 seconds
    >
    > XPPro .NET console app to localhost, or remote
    > First took 0 seconds
    > Short sleep 1 took 0 seconds
    > Short sleep 2 took 0 seconds
    > Long sleep 1 took 0 seconds
    > Med sleep 2 took 0 seconds
    >
    > W2K Server to local host, or remote
    > First took 0 seconds
    > Short sleep 1 took 0 seconds
    > Short sleep 2 took 0 seconds
    > Long sleep 1 took 0 seconds
    > Med sleep 2 took 0 seconds
    >
    > Pertinent ASP.NET code behind:
    > ...
    > private void RunTests_Click(object sender, System.EventArgs e)
    > {
    > Output.Text = Tester.RunTests( HostName.Text, "<br>" );
    > }
    >
    > Pertinent .NET console app code.
    > ...
    > static void Main(string[] args)
    > {
    > System.Console.WriteLine( SocketTest.Tester.RunTests( args[0], "\n" ) );
    > }
    >
    > The tester called by ASP.NET and a .NET console app:
    >
    > using System;
    > using System.Net;
    > using System.Net.Sockets;
    >
    > namespace SocketTest
    > {
    > public class Tester
    > {
    > public Tester() {}
    >
    > public static string RunTests( string server, string eol )
    > {
    > string ret = RunTest( server, "First ", eol );
    >
    > System.Threading.Thread.Sleep( 100 );
    >
    > ret += RunTest( server, "Short sleep 1", eol );
    >
    > System.Threading.Thread.Sleep( 100 );
    >
    > ret += RunTest( server, "Short sleep 2", eol );
    >
    > System.Threading.Thread.Sleep( 10000 );
    >
    > ret += RunTest( server, "Long sleep 1", eol );
    >
    > System.Threading.Thread.Sleep( 5000 );
    >
    > ret += RunTest( server, "Med sleep 2", eol );
    >
    > return ret;
    > }
    >
    > static string RunTest( string server, string prefix, string eol )
    > {
    > DateTime start = DateTime.Now;
    > TcpClient conn = new TcpClient( server, 80 );
    > TimeSpan span = DateTime.Now - start;
    > conn.Close();
    >
    > return prefix + " took " + span.Seconds + " seconds " + eol;
    > }
    > }
    > }
    >
    >
    >
    >
    >
    Manohar Kamath, Oct 1, 2004
    #2
    1. Advertising

  3. Jim W

    Sekhar Guest

    I had the same issue. I never expected that it was my data in few
    dropdowns causing this delay. On the server running as localhost its
    super fast but when run on a client, it takes some time for the data
    to transfer over to it and hence the dealy.

    Sekhar.

    "Jim W" <> wrote in message news:<>...
    > This is a cross-post from the .NET group since it looks like it may not be
    > .NET.
    >
    > New information since the original post is that is the wireless network is
    > enabled and connected the socket connect time is 4x longer! Disable wireless
    > and it is back down to just very slow.
    >
    > Any ideas are appreciated.
    >
    > -----
    > I have an ASP.NET app that has very slow connect times using TCPClient, or
    > the Socket class, or even calling a COM object that uses C socket calls on
    > certain similar XP SP2 boxes.
    >
    > On those boxes, if another connection is made within a couple seconds, it is
    > fast. Running the same C# code in a console app connects instantly.
    > Unplugging the network cable allows localhost connections to be instant (?!).
    >
    >
    > Running the same ASP.NET app on W2K or another XP Pro SP2 box is instant, so
    > it comes down to being ASP.NET on XP Pro on certain boxes. I've includes the
    > test results and programs. The boxes with the problems are laptops. Is it
    > an ASP.NET config issue? XP SP2 Security issue? Any ideas/help is greatly
    > appreciated.
    >
    > Jim W
    >
    > Test results:
    > XPPro ASP to Remote server
    > First took 6 seconds
    > Short sleep 1 took 0 seconds
    > Short sleep 2 took 0 seconds
    > Long sleep 1 took 4 seconds
    > Med sleep 2 took 0 seconds
    >
    > XPPro ASP to Localhost with network connection
    > First took 6 seconds
    > Short sleep 1 took 0 seconds
    > Short sleep 2 took 0 seconds
    > Long sleep 1 took 4 seconds
    > Mec sleep 2 took 4 seconds
    >
    > XPPro ASP to Localhost unplugged
    > First took 0 seconds
    > Short sleep 1 took 0 seconds
    > Short sleep 2 took 0 seconds
    > Long sleep 1 took 0 seconds
    > Med sleep 2 took 0 seconds
    >
    > XPPro .NET console app to localhost, or remote
    > First took 0 seconds
    > Short sleep 1 took 0 seconds
    > Short sleep 2 took 0 seconds
    > Long sleep 1 took 0 seconds
    > Med sleep 2 took 0 seconds
    >
    > W2K Server to local host, or remote
    > First took 0 seconds
    > Short sleep 1 took 0 seconds
    > Short sleep 2 took 0 seconds
    > Long sleep 1 took 0 seconds
    > Med sleep 2 took 0 seconds
    >
    > Pertinent ASP.NET code behind:
    > ...
    > private void RunTests_Click(object sender, System.EventArgs e)
    > {
    > Output.Text = Tester.RunTests( HostName.Text, "<br>" );
    > }
    >
    > Pertinent .NET console app code.
    > ...
    > static void Main(string[] args)
    > {
    > System.Console.WriteLine( SocketTest.Tester.RunTests( args[0], "\n" ) );
    > }
    >
    > The tester called by ASP.NET and a .NET console app:
    >
    > using System;
    > using System.Net;
    > using System.Net.Sockets;
    >
    > namespace SocketTest
    > {
    > public class Tester
    > {
    > public Tester() {}
    >
    > public static string RunTests( string server, string eol )
    > {
    > string ret = RunTest( server, "First ", eol );
    >
    > System.Threading.Thread.Sleep( 100 );
    >
    > ret += RunTest( server, "Short sleep 1", eol );
    >
    > System.Threading.Thread.Sleep( 100 );
    >
    > ret += RunTest( server, "Short sleep 2", eol );
    >
    > System.Threading.Thread.Sleep( 10000 );
    >
    > ret += RunTest( server, "Long sleep 1", eol );
    >
    > System.Threading.Thread.Sleep( 5000 );
    >
    > ret += RunTest( server, "Med sleep 2", eol );
    >
    > return ret;
    > }
    >
    > static string RunTest( string server, string prefix, string eol )
    > {
    > DateTime start = DateTime.Now;
    > TcpClient conn = new TcpClient( server, 80 );
    > TimeSpan span = DateTime.Now - start;
    > conn.Close();
    >
    > return prefix + " took " + span.Seconds + " seconds " + eol;
    > }
    > }
    > }
    Sekhar, Oct 22, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Elbert Lev

    poplib for multihomed machines

    Elbert Lev, Jun 28, 2004, in forum: Python
    Replies:
    8
    Views:
    343
    Jorgen Grahn
    Jul 3, 2004
  2. Replies:
    2
    Views:
    285
  3. Laszlo Nagy
    Replies:
    1
    Views:
    4,776
    Mark Wooding
    Jan 27, 2009
  4. Jean-Paul Calderone
    Replies:
    0
    Views:
    952
    Jean-Paul Calderone
    Jan 27, 2009
  5. Daniel Berger
    Replies:
    5
    Views:
    146
    Daniel Berger
    Jul 19, 2007
Loading...

Share This Page