Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Slow opening socket on ASP with multihomed machine
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 wireles
s
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 th
e
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;
}
}
}






Report this thread to moderator Post Follow-up to this message
Old Post
Jim W
10-01-04 08:55 PM


Re: Slow opening socket on ASP with multihomed machine
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" <JimW@discussions.microsoft.com> wrote in message
news:F53F524B-835B-4B3F-8D95-87ABCAA64356@microsoft.com...
> 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;
> }
> }
> }
>
>
>
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Manohar Kamath
10-01-04 08:55 PM


Re: Slow opening socket on ASP with multihomed machine
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" <JimW@discussions.microsoft.com> wrote in message news:<F53F524B-835B-4B3F-8D95-87A
BCAA64356@microsoft.com>...
> 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 wirel
ess
> 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 i
t
> an ASP.NET config issue?  XP SP2 Security issue?  Any ideas/help is greatl
y
> 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;
> 		}
> 	}
> }

Report this thread to moderator Post Follow-up to this message
Old Post
Sekhar
10-23-04 01:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

ASP archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:41 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.