Showing posts with label socket. Show all posts
Showing posts with label socket. Show all posts

Tuesday, March 13, 2012

TCPClient connect slow only on XP Pro ASP on some boxes

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;
}
}
}most likely you proxy server setting don't exclude localhost.

-- bruce (sqlwork.com)

"Jim W" <JimW@.discussions.microsoft.com> wrote in message
news:5F733251-4CAF-4EF9-98AA-0CA14F103854@.microsoft.com...
> 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;
> }
> }
> }
Tx for the reply. I can't find any IIS proxy settings, can you give some
details? I'm not using a proxy in the IE settings. I did try turning the
proxy on, and excluded localhost, and it still is slow.

"bruce barker" wrote:

> most likely you proxy server setting don't exclude localhost.
> -- bruce (sqlwork.com)
New information. The slow computers have a gigbit network and wireless. If
the network cable is attached, *and* wireless is connected, the connect time
goes from 6 seconds (with just the network) to 27 seconds!
Jim,

We're experiencing (in a somewhat different context) the exactsame problem. We're as clueless as you seem to be. I can'treally relate to the suggestion that your proxy settings mighthave something to do with it, but who knows. Have you made anyprogress towards resolution since you posted your question?

Andre

> I have an ASP.NET app that has very slow connect times usingTCPClient, or
> the Socket class, or even calling a COM object that uses Csocket calls on
> certain similar XP SP2 boxes.
> On those boxes, if another connection is made within a coupleseconds, it is
> fast. Running the same C# code in a console app connectsinstantly.
> Unplugging the network cable allows localhost connections to beinstant (?!).
>
> Running the same ASP.NET app on W2K or another XP Pro SP2 boxis 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 arelaptops. Is it
> an ASP.NET config issue? XP SP2 Security issue? Anyideas/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, stringeol )
> {
> DateTime start = DateTime.Now;
> TcpClient conn = new TcpClient( server, 80 );
> TimeSpan span = DateTime.Now - start;
> conn.Close();
> return prefix + " took " + span.Seconds + " seconds " +eol;
> }
> }
> }
User submitted from AEWNET (http://www.aewnet.com/)
No, I haven't found a solution. On the production machines, which are not
multihomed, it is not an issue, but it's on my todo list.

I will post if I find a solution. Please post if you find one.

"Andre de Lange" wrote:

> Jim,
> We're experiencing (in a somewhat different context) the exact same problem. We're as clueless as you seem to be. I can't really relate to the suggestion that your proxy settings might have something to do with it, but who knows. Have you made any progress towards resolution since you posted your question?
> Andre

TCPClient connect slow only on XP Pro ASP on some boxes

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;
}
}
}most likely you proxy server setting don't exclude localhost.
-- bruce (sqlwork.com)
"Jim W" <JimW@.discussions.microsoft.com> wrote in message
news:5F733251-4CAF-4EF9-98AA-0CA14F103854@.microsoft.com...
> 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;
> }
> }
> }
>
Tx for the reply. I can't find any IIS proxy settings, can you give some
details? I'm not using a proxy in the IE settings. I did try turning the
proxy on, and excluded localhost, and it still is slow.
"bruce barker" wrote:

> most likely you proxy server setting don't exclude localhost.
> -- bruce (sqlwork.com)
>
New information. The slow computers have a gigbit network and wireless. If
the network cable is attached, *and* wireless is connected, the connect time
goes from 6 seconds (with just the network) to 27 seconds!
Jim,
We're experiencing (in a somewhat different context) the exact=
same problem. We're as clueless as you seem to be. I can't=
really relate to the suggestion that your proxy settings might=
have something to do with it, but who knows. Have you made any=
progress towards resolution since you posted your question?
Andre

> 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 =09
> Pertinent ASP.NET code behind:
> ...
> private void RunTests_Click(object sender, System.EventArgs e)
> {
> =09Output.Text =3D Tester.RunTests( HostName.Text, "<br>" );
> }
> Pertinent .NET console app code.
> ...
> static void Main(string[] args)
> {
> =09System.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
> {
> =09public class Tester
> =09{
> =09=09public Tester() {}
> =09=09public static string RunTests( string server, string eol )
> =09=09{
> =09=09=09string ret =3D RunTest( server, "First ", eol );
> =09=09=09System.Threading.Thread.Sleep( 100 );
> =09=09=09
> =09=09=09ret +=3D RunTest( server, "Short sleep 1", eol );
> =09=09=09System.Threading.Thread.Sleep( 100 );
> =09=09=09
> =09=09=09ret +=3D RunTest( server, "Short sleep 2", eol );
> =09=09=09System.Threading.Thread.Sleep( 10000 );
> =09=09=09
> =09=09=09ret +=3D RunTest( server, "Long sleep 1", eol );
> =09=09=09System.Threading.Thread.Sleep( 5000 );
> =09=09=09
> =09=09=09ret +=3D RunTest( server, "Med sleep 2", eol );
> =09=09=09return ret;
> =09=09}
> =09=09static string RunTest( string server, string prefix, string=
eol )
> =09=09{
> =09=09=09DateTime start =3D DateTime.Now;
> =09=09=09TcpClient conn =3D new TcpClient( server, 80 );
> =09=09=09TimeSpan span =3D DateTime.Now - start;
> =09=09=09conn.Close();
> =09=09=09return prefix + " took " + span.Seconds + " seconds " +=
eol;
> =09=09}
> =09}
> }
>
User submitted from AEWNET (http://www.aewnet.com/)
No, I haven't found a solution. On the production machines, which are not
multihomed, it is not an issue, but it's on my todo list.
I will post if I find a solution. Please post if you find one.
"Andre de Lange" wrote:

> Jim,
> We're experiencing (in a somewhat different context) the exact same problem. We're
as clueless as you seem to be. I can't really relate to the suggestion that your pr
oxy settings might have something to do with it, but who knows. Have you made any pr
ogr
ess towards resolution since you posted your question?
> Andre

tcpclient socket webrequest

tcpclient socket webrequest

what are each used for? I read some reference books and did some research on
the internet, but I'm still confused.
could someone clarify this for me?

Thanks,
AaronHi Aaron,

Basically, you're lloking at similar types of classes for different levels
of network communication.

A Socket is a class for any type of network connection. It is a low-level,
generic class for sending and receiving data over a network, and can work
with virtually any type of protocol.

A TCPClient is a higher-level class for working with the TCP protocol. It
has a Socket (protected Client property) that does the actual connection,
and has properties and methods for communicating via the TCP protocol.

A WebRequest is a higher-level class for sending an HTTP Request over a TCP
connection. It contains properties and methods for sending an HTTP Request,
as well as properties and methods for receiving the HTTP Response that comes
back.

These are an excellent example of how Microsoft provides programming tools
of virtually any level necessary to perform development tasks. For example,
you could write your own TCP Client class by creating a class that uses a
Socket to connect to a TCP port. You could further extend that class by
creating a class that sends an HTTP Request and listens for an HTTP
Response. But Microsoft has already created such classes for you. On the
other hand, if you needed to create an FTP client, which Microsoft has NOT
provided, you could start with a Socket and go from there, building your own
properties and methods to send and receive FTP proptocol messages over a TCP
port.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"Aaron" <kuya789@.yahoo.com> wrote in message
news:O56fHf%23QFHA.2348@.tk2msftngp13.phx.gbl...
> tcpclient socket webrequest
>
> what are each used for? I read some reference books and did some research
> on the internet, but I'm still confused.
> could someone clarify this for me?
>
> Thanks,
> Aaron
thank you.

i always thought the ftp protocal was built on tcp. so i need to use sockets
instead of tcpclient?

is there anything lower than sockets?
what is the lowest level .Net can access? what about C/native unmanged?

Aaron

"Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> wrote in message
news:ebCq0mBRFHA.164@.TK2MSFTNGP12.phx.gbl...
> Hi Aaron,
> Basically, you're lloking at similar types of classes for different levels
> of network communication.
> A Socket is a class for any type of network connection. It is a low-level,
> generic class for sending and receiving data over a network, and can work
> with virtually any type of protocol.
> A TCPClient is a higher-level class for working with the TCP protocol. It
> has a Socket (protected Client property) that does the actual connection,
> and has properties and methods for communicating via the TCP protocol.
> A WebRequest is a higher-level class for sending an HTTP Request over a
> TCP connection. It contains properties and methods for sending an HTTP
> Request, as well as properties and methods for receiving the HTTP Response
> that comes back.
> These are an excellent example of how Microsoft provides programming tools
> of virtually any level necessary to perform development tasks. For
> example, you could write your own TCP Client class by creating a class
> that uses a Socket to connect to a TCP port. You could further extend that
> class by creating a class that sends an HTTP Request and listens for an
> HTTP Response. But Microsoft has already created such classes for you. On
> the other hand, if you needed to create an FTP client, which Microsoft has
> NOT provided, you could start with a Socket and go from there, building
> your own properties and methods to send and receive FTP proptocol messages
> over a TCP port.
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> What You Seek Is What You Get.
> "Aaron" <kuya789@.yahoo.com> wrote in message
> news:O56fHf%23QFHA.2348@.tk2msftngp13.phx.gbl...
>> tcpclient socket webrequest
>>
>>
>> what are each used for? I read some reference books and did some research
>> on the internet, but I'm still confused.
>> could someone clarify this for me?
>>
>>
>> Thanks,
>> Aaron
>>
> is there anything lower than sockets?
> what is the lowest level .Net can access? what about C/native unmanged?

Yes, there is PLENTY lower than Sockets. As for the lowest level that .Net
can access, I would have to guess Assembler (not MSIL - Assembler), as C
allows inline Assembler, C++ is a superset of C, and C# allows inline C++
(unsafe/unmanaged). On the other hand, I wouldn't know for sure, as I
haven't had occasion to use Assembler for many years!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"Aaron" <kuya789@.yahoo.com> wrote in message
news:utp4WTERFHA.3336@.TK2MSFTNGP09.phx.gbl...
> thank you.
> i always thought the ftp protocal was built on tcp. so i need to use
> sockets instead of tcpclient?
> is there anything lower than sockets?
> what is the lowest level .Net can access? what about C/native unmanged?
> Aaron
> "Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> wrote in message
> news:ebCq0mBRFHA.164@.TK2MSFTNGP12.phx.gbl...
>> Hi Aaron,
>>
>> Basically, you're lloking at similar types of classes for different
>> levels of network communication.
>>
>> A Socket is a class for any type of network connection. It is a
>> low-level, generic class for sending and receiving data over a network,
>> and can work with virtually any type of protocol.
>>
>> A TCPClient is a higher-level class for working with the TCP protocol. It
>> has a Socket (protected Client property) that does the actual connection,
>> and has properties and methods for communicating via the TCP protocol.
>>
>> A WebRequest is a higher-level class for sending an HTTP Request over a
>> TCP connection. It contains properties and methods for sending an HTTP
>> Request, as well as properties and methods for receiving the HTTP
>> Response that comes back.
>>
>> These are an excellent example of how Microsoft provides programming
>> tools of virtually any level necessary to perform development tasks. For
>> example, you could write your own TCP Client class by creating a class
>> that uses a Socket to connect to a TCP port. You could further extend
>> that class by creating a class that sends an HTTP Request and listens for
>> an HTTP Response. But Microsoft has already created such classes for you.
>> On the other hand, if you needed to create an FTP client, which Microsoft
>> has NOT provided, you could start with a Socket and go from there,
>> building your own properties and methods to send and receive FTP
>> proptocol messages over a TCP port.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> .Net Developer
>> What You Seek Is What You Get.
>>
>> "Aaron" <kuya789@.yahoo.com> wrote in message
>> news:O56fHf%23QFHA.2348@.tk2msftngp13.phx.gbl...
>>> tcpclient socket webrequest
>>>
>>>
>>> what are each used for? I read some reference books and did some
>>> research on the internet, but I'm still confused.
>>> could someone clarify this for me?
>>>
>>>
>>> Thanks,
>>> Aaron
>>>
>>
>>

tcpclient socket webrequest

tcpclient socket webrequest
what are each used for? I read some reference books and did some research on
the internet, but I'm still .
could someone clarify this for me?
Thanks,
AaronHi Aaron,
Basically, you're lloking at similar types of classes for different levels
of network communication.
A Socket is a class for any type of network connection. It is a low-level,
generic class for sending and receiving data over a network, and can work
with virtually any type of protocol.
A TCPClient is a higher-level class for working with the TCP protocol. It
has a Socket (protected Client property) that does the actual connection,
and has properties and methods for communicating via the TCP protocol.
A WebRequest is a higher-level class for sending an HTTP Request over a TCP
connection. It contains properties and methods for sending an HTTP Request,
as well as properties and methods for receiving the HTTP Response that comes
back.
These are an excellent example of how Microsoft provides programming tools
of virtually any level necessary to perform development tasks. For example,
you could write your own TCP Client class by creating a class that uses a
Socket to connect to a TCP port. You could further extend that class by
creating a class that sends an HTTP Request and listens for an HTTP
Response. But Microsoft has already created such classes for you. On the
other hand, if you needed to create an FTP client, which Microsoft has NOT
provided, you could start with a Socket and go from there, building your own
properties and methods to send and receive FTP proptocol messages over a TCP
port.
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
What You S Is What You Get.
"Aaron" <kuya789@.yahoo.com> wrote in message
news:O56fHf%23QFHA.2348@.tk2msftngp13.phx.gbl...
> tcpclient socket webrequest
>
> what are each used for? I read some reference books and did some research
> on the internet, but I'm still .
> could someone clarify this for me?
>
> Thanks,
> Aaron
>
thank you.
i always thought the ftp protocal was built on tcp. so i need to use sockets
instead of tcpclient?
is there anything lower than sockets?
what is the lowest level .Net can access? what about C/native unmanged?
Aaron
"Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> wrote in message
news:ebCq0mBRFHA.164@.TK2MSFTNGP12.phx.gbl...
> Hi Aaron,
> Basically, you're lloking at similar types of classes for different levels
> of network communication.
> A Socket is a class for any type of network connection. It is a low-level,
> generic class for sending and receiving data over a network, and can work
> with virtually any type of protocol.
> A TCPClient is a higher-level class for working with the TCP protocol. It
> has a Socket (protected Client property) that does the actual connection,
> and has properties and methods for communicating via the TCP protocol.
> A WebRequest is a higher-level class for sending an HTTP Request over a
> TCP connection. It contains properties and methods for sending an HTTP
> Request, as well as properties and methods for receiving the HTTP Response
> that comes back.
> These are an excellent example of how Microsoft provides programming tools
> of virtually any level necessary to perform development tasks. For
> example, you could write your own TCP Client class by creating a class
> that uses a Socket to connect to a TCP port. You could further extend that
> class by creating a class that sends an HTTP Request and listens for an
> HTTP Response. But Microsoft has already created such classes for you. On
> the other hand, if you needed to create an FTP client, which Microsoft has
> NOT provided, you could start with a Socket and go from there, building
> your own properties and methods to send and receive FTP proptocol messages
> over a TCP port.
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> What You S Is What You Get.
> "Aaron" <kuya789@.yahoo.com> wrote in message
> news:O56fHf%23QFHA.2348@.tk2msftngp13.phx.gbl...
>
> is there anything lower than sockets?
> what is the lowest level .Net can access? what about C/native unmanged?
Yes, there is PLENTY lower than Sockets. As for the lowest level that .Net
can access, I would have to guess Assembler (not MSIL - Assembler), as C
allows inline Assembler, C++ is a superset of C, and C# allows inline C++
(unsafe/unmanaged). On the other hand, I wouldn't know for sure, as I
haven't had occasion to use Assembler for many years!
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
What You S Is What You Get.
"Aaron" <kuya789@.yahoo.com> wrote in message
news:utp4WTERFHA.3336@.TK2MSFTNGP09.phx.gbl...
> thank you.
> i always thought the ftp protocal was built on tcp. so i need to use
> sockets instead of tcpclient?
> is there anything lower than sockets?
> what is the lowest level .Net can access? what about C/native unmanged?
> Aaron
> "Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> wrote in message
> news:ebCq0mBRFHA.164@.TK2MSFTNGP12.phx.gbl...
>